Added date picker, reorganized init code