Apply State pattern
Merge branch 'develop'