starting to refactor data access