Changed visitor

- Change visitor class
- Created 3 different type of nodes
- Code  cleanup