Some optimizations

I just understood the reason of all of it