Refactored module layout

Changed the module layout to enable easier editing and reading.