Basic refactoring in RState.apply