You may want to remove `erlang_lib_dir` from here and pass it as argument so you don't calculate it over and over again.