restructure module and workflow codes