re write of the TCode Class