refactor dates