ppp: simplify code using existing functions