restructed main program flow to include brew state using state_handler and key_value store in redis