refactoring PS