Deduplicate the ravenFactory code to generate instances
Ensure that a parameter can be null