Refactoring boxes