refactoring dates