each() method, and optimization