container_ptr refactoring