Refactored `if` condition