[elixir] refactor