I am all for pointers, but this is slightly inconsistent with the rest of the components in the system. Perhaps I have not seen all the call sites, but the function internally assumes none of the values are nullptr. I think we should set all but ```state``` to be const & and result should be a return value of the function.