WIP! ruthless refactoring, changes to layout