enhance rule definition and parsing logic