Fix context error with moving visitor instance creation into separate factory object.