freestyle build refactoring