updating mysqldb
Refactoring database code