Refactored functions of cleanup and deploy scripts to common utils.py file that can be placed in the CLI's ext directory.