better cast safe documentation