Reorganizing build code into a separate class