Moved the code for database management into modular class files