moved parsing of rules before validation so rules can be merged