Framework for processing steps in a sorting algorithm