Refactoring + pywizard code transfer