Sort by type.