enhance and modulize repl