Fix both click bug.
SOme refactoring.