Basic visitor pattern implementation and extensions