Some small refactoring in container_pool