#1 Clean up the code into a single .js file, calling it when loading each layout