Adding some type safety to the library