Maybe `Enum.split/2` would be better here?

```elixir
{ mod, name } = modules |> String.split(".") |> Enum.split(-1)
{ Enum.join(mod, "."), hd(name), arity }
```