try to fix ussage of container_ref in function contiguous optimization