Refactored PMC code