Refactor method to pull out time by parameter