Refactors to prevent setting of end_time incorrectly