Not sure what the purpose of this code is, if this condition fails  function will die as the key 'latest' doesn't exist. What is the purpose of 'latest'? Why not just create and return  the container, returning the cached version if it exists?