Added a database abstraction layer