optimizing click events