Refactor cloudstack connection class