improved ordering of tables (based on visibilty)