Optimize click event