State pattern demostration