Refactored Main and CloudClient, implemented CloudState and build executor that updates the state every X seconds.