first big tidy up of build process