Sounds like you are using Elixir’s built-in lists. Maybe you should switch to a library like this one ?