Refactor factories #6
Update test case for dumping object as file #6
Enhace dump object as file method #6