separate files for modules, tidy up and more