refactoring of BuildController