rx refactoring