Implementation of Visitor Pattern