Implementation: type safety