Refactoring + json get state action