use define-minor-mode / some refactorings