[enh] Use context manager
[enh] Use context manager