Refactored key generator into loop
Refactored generators in jQuery and private click method