Code cleanup & Auto create MySQL database and tables