Also adjusts rule templates filtering to be able to deal with optional states/events/actions in interfaces