Refactored some, made REPL prettier