Final refactoring for `pf`