added some structure to deploy_code