refactored build into different modules