fix border-box problem, refactoring