methodized a click handler to make things more readable