completely refactor the date parsing