don't trivially duplicate code like this.  Use the same pattern you've used elsewhere to create event handlers in a loop and keep track of what you've seen in an object of some sort.