Improve sort rule