Added support for chained rules and reading from config