Now also accepts date range

Plus cleanup + robustness