cleaning up some of the datetime handling