Factor out a database object