major build refactor