refactored - return component object when registering component