add Application State pattern