refactoring Names controller; combining all sort path into one