refactored and added build