Extract Method: PromptFactory::invoke().

Most of the time the prompts are created just to be immediately invoked.
This helper method just makes that default behavior simple.