Improve rule dsl

It's using a better DSL for the rules.