code refactoring for date supports