ENH: Change sorting order and added cache