factory requires class