type sanity here should be the responsibility of the caller