reorganize stuff in TDL parser