Refactor build infrastructure.