ENH making functions more elixir idiomatic