refactor build graphs & remove duplication