some type safety updates