Reorder parameters for construct method.
Remove unneeded calls to close method.