Improved if condition