minor refactoring.  fixed bug related to click mapping