build refactored