refactor using melpa