Refactored p2