Added some type safety