database prepared to Dependency injection pattern