Convert to using errorcaller and io.Closer