Remove unnecessary sorting of types