Refactoring build scripts