apply_rule() extracted and consulting in memory model