refactor build process a bit