use a go interface instead of a closure