Add output directory to python generator
Refactor files