minor refactorings on padding