start using time.Duration instead of int