simplification, unnecessary setting key and methods. make sure file input stream is closed.