Cleanup interface by removing ugly HashMap and use Core functions inside
Trajectory.