Extract framework to the DbContextHooks class