added a database abstraction layer, starting to work with the metadata factory