Reorganize order of tables and algorithm a bit so that we don't waste pages for nothing.