Actually I think the 2.4 was a decent engine before 2011. I think that year also correlates to it going GDI but IDK if that's why they went downhill or if it was the casting issue (leaving swarf in the blocks at the factory IIRC.)
Our 2008 Elantra was a very solid car but I'd avoid H/K until they straighten out their issues.