Refactoring DB context