Refactor work set menu sorting event handler