Implemented a Basic State Pattern