refactory deploy scripts