Adjust forms and datepicker. Some refactoring.