May someone give me advice on how to optimize this system?

To be honest I don’t remember why or where did I get this system from, but some time ago I only use booleans, and then some gameplay bugs appeared when, for example, crouching and running at the same time and vice versa. That’s why I tried to make a solid system that checks which exact movement is the player performing.