Cleaner implementation for pfn that doesn't need an 'is compiling' flag.