remove unuseful typdefs and replace X by T when appropriated.