I'd prefer if you could keep this class in your application code for now as it only works for the root object. Would that work for you?