refactor addResource to PGP