refactoring date and nullable