refactoring RPS