some improvements on TrajectoryParser