Improved time-varying reproduction numbers using the generation interval for COVID-19