                       {name, '#{vsn}', t}
                   end
                 end)}
-    write_terms(path, relfile)
-  end
-
-  defp write_terms(path, terms) do
-    :file.write_file('#{path}', :io_lib.fwrite('~p.\n', [terms]), [encoding: :utf8])
+    Utils.write_term(path, relfile)
   end
 
   defp write_binfile(release, output_dir, rel_dir) do

  end

  defp strip_release(%Release{profile: %Profile{strip_debug_info: true, dev_mode: true}} = release, output_dir) do
    case :beam_lib.strip_release(output_dir) do
      :ok ->
        {:ok, release}

      for app <- apps do
        copy_app(output_dir, app, release)
      end
      # Copy consolidated .beams
      build_path = Mix.Project.build_path(Mix.Project.config)
      File.cp_r!(
        Path.join(build_path, "consolidated"),
        Path.join([output_dir, "lib", "#{release.name}-#{release.version}", "consolidated"]))
      {:ok, apps}
    rescue
      err ->
