refactor elixir mode