Refactored to use DynamicObject