pp refactor