Is there any way to remove the as any in the update_substate function? It\'s type safe when invoking the update_state function directly so indirectly
as any
update_substate