Started restructuring the code to match the new design