sortCandidateEntities simplified