Adds chaining logic to rewrite conditions.