Refactoring build process