refactory emacs