refactored the layout