Refactor manager and cloudstack client