Code refactoring for boxes display.