Refactor build dependencies