refactoring and creating a new class Rule.java