Refactor build slightly