Further clean up of page ordereing code.