Some tweaking of layout
Some serious refactoring, because files were starting to get too big