Refactored build system