Refactor ContributionManager code