Sort order UI and internal clean up