improvements to parsing dates