Refactoring p8