Support for datepicker + some cleanup