little improvement in the code with an unnecessary test