Generalization and improvement to PDS handler