container_ptr big refactoring