State design pattern added.