Merge some changes from #3530
Fix: #1620 use US paper size in US, CA and PH
Refactor core/custom modules