Refactor code for MELPA