refactored rule execution. [skip ci]