changed ref to use const pointers because storage is mutable.