optimise get_entities wrt multiple lookups of entity in result array