massive build refactor