Replaced unnecessary ternary with ! operator