improve type safety