refactor date