Proper implementation of RegisterInstance