Build system refactoring