Works faster then checking each result item with isinstance