npd: Split function implementations.
npd: Mark some functions as static.