Better handling of click events