made code a bit more explicit and removed repl as we don't need it