rationalize order of tables in db