We could use try-with-resource here instead of closing manually.