def nested_inc(op, _, attr_val, attr_name, state, step=1):
    """Increments relevant counter by step from args array"""
    oph = state.setdefault(op, {})
    nameh = oph.setdefault(attr_name, {})
    nameh.setdefault(attr_val, 0)
    nameh[attr_val] += step
    return state
