Optimizations: forEach and eventListener