refactor db to add abstraction from EF