added deploymenthandler, refactored build scripts