major refactor of build process