Added visitor pattern and count beta now uses the visitor pattern.