Move output file creation to #getWriter