refactor sort command handler
rename automaticSort