Redesign of sorting