implemented type safety