Code review and refactoring of date picker