Refactoring the rules to remove unnecessary getters and use the rules factory for testing