mac build refactored