Refactoring data access layer (preparation for DI)