Refactoring in moderation plugin