Refactors out class factory method. Yuck.