Refactored print logic out of main repl loop for future plugin functionality