refactor code to utilize date/time classes