Replace widget_registry with class level functions.