Tidy up of onClick for sorting.