Refactor the cloud controller - multi commit - 10