Added a factory to crate a DB object