Refactoring: extract typeregistry interface