add virtual destructor to factory
add serialization method to factory
Change factory container type