extracted date parsing into methods