refactored sorters