refactoring using datetime for dates and times :)