Cleaned up duplicated code in column sorting modal.