P12 refactoring