Tidied up the click event binding.