Improve efficiency of sorting term drop-down lists