Merge pull request #593 from youyong205/master

refactor
modify the state delegate