ViewstateRepository refactoring