The structural and magnetic order are the decisive elements which vastly determine the properties of smart ternary intermetallics such as X2YZ Heusler alloys. Here, X and Y are transition metal elements and Z is an element from the III-V group. In order to give a precise prescription of the possibilities to optimize the magnetic shape memory and magnetocaloric effects of these alloys, we use density functional theory calculations. In particular, we outline how one may find new intermetallics which show higher Curie and martensite transformation temperatures when compared with the prototypical magnetic shape-memory alloy Ni2MnGa. Higher operation temperatures are needed for technological applications at elevated temperatures.