use thrift pointer util functions instead of reinventing the wheel