simplified repl implementation