Function for simplified registering to factory.
Remove unused code.