Minimizing use of jquery each() due to performance issues.