Refactored building scripts.