[COREVM-67] Use the factory pattern for creating dynamic objects
Merge pull request #5 from yanzhengli/COREVM-67_factory_pattern_for_object_creation

[COREVM-67] Use the factory pattern for creating dynamic objects