added and refactored data access