changed state structure, more switch state work