make better use of goroutines