Newforma interview question

Refactor code to use the Factory pattern