Reorganized npd and phz for better compartmentalization.