finished refactoring dataAccess