Lithuania subsequently restructured its economy for integration into Western European institutions ; it joined both NATO and the EU in the spring of 2004 .