first working refactored build