Implementation of RegisterInstance