repl, some internal changes