Rewrite of cloud management script