Task input/output refactoring
fix pep8 warnings and errors

fix typos
separate migration functions