With the exception of the `if container.Config.StdinOnce` condition above, these three anonymous functions look the same. Is it possible to abstract them out into a parameterized function?