Simplified if condition as per review comment