should it be a factory class not a closure? Like I did for registry and other stuff.