Simplify custom tasks and preserve comment in generated files