Code style.
Refactor cyclomatic complexity.
Fix some typos in naming - it is named "date format" and not "date formate".