Learned Some Stuffs (tm) to simplify type generation code