refactoring, improvements to layout