Extract registerCreator method

Make it easier to register a custom creator.
Merge pull request #5512 from alprs/fix/extract-register-creator

Extract registerCreator method