instantiate db in Factory
merged