Explain why we currently use a tempfile, TODO to think about fixing this.