implement Visitor pattern, and adapter pattern