Improve constant sorting