factor out DPB code into its own module