Re-arrange sort_by