separated all database/cloud related logic into Model class