example repl implementation simplified