Refactored out the layout
DRYed up with loops