Rewrites template compilation