DRYing event handlers in modal