date refactor