Remove a redundant part of a warning
Simplify logic