Created SortClass and based all sorting methods to use it.