refactored rpsApp