Refactors the creation of the survey question components into a factory