Slight rewrite of onclicklisteners.