separater data access logic to service layer