refactoring build scripts