performance boost if we can sort terms