combining visitor and composite pattern