improved if else more