Simplify repl code with respect to building the environment