Refactored p13