This is not a public API (at the moment), but we will be needing this for other internal things soon.