Refactor build