factoring out pqr calculation