Adding a rules factory to decouple the parser with the rules hierarchy and better test through mocks