apply-rules