Updated visitor pattern with example