There are a number of econometrics tools to deal with the different types of situations in which cointegration can appear: I(1), I(2), seasonal, polyno- mial, etc. There are also different kinds of Vector Error Correction models related to these situations. The authors propose a unified theoretical and practical framework to deal with many of these situations. To this aim: (i) they introduce a general class of models and (ii) provide an automatic method to identify models, based on estimating the Smith form of an autoregressive model. Their simulations suggest the power of the new proposed methodology. An empirical example illustrates the methodology.