move container setup logic to separate function