Refactoring QInteractiveConsole