Replace Obj.magic trick by a recursive definition