refractor each, find & findAll functions