Implemented State and Visitor design pattern framework.