A little refactoring + commented code removed. Added a logger class that will be used in the generated code to trace steps, local values, method calls, etc.