Refactoring CustomRule
Adding inheritance for Rule