nvagent: code cleanup