refactor pryrc