Small refactor to simplify REPL interaction