Refactor a lot of functionality, improve the registration and behavior for open generics.