Refactoring, and using PAP