cleaning up npr code