extracted db ops to service class