These should be defined as separate methods, á la `onClose`.