refactoring data access 2