Declare your views logic using state machine