Cleanup: simplify generate-if