use context managers for repl