Added type registration and lazy loading.