renaming all tables and cleaning up etc