Might be more clear to just reimplement this without using Closeables... it's not gonna be a very long function.