Sample code for visitor pattern