refactoring so that goroutine calls non closure