Refactor for nullable sheet name changes

Refactor for review.

Thanks.
wait .. u need != null here, the exact pattern i was thinking is:

out = new PrintStream(..);
try {
  err = new ..;
  try {
     try {
     } finally {
     }
  } finally {
    err.close();
  }
} finally {
  out.close();
}