What is this trying to do? aka, is there functionality in that click handler that can be moved to a function that is a) called by the click handler and b) called here?