Fixes #4286: Refactor code from Rule category repository