Add some more closure functions so it is easier to write safe code around them