padding adjustment, code cleanup