added methods and class to support the "Visitor" pattern