org-mode - Refactor defun and hook.