Optimization

It optimizes the number checks, eliminate a double check and facilitate compression of the code.