ncd: Refactor the function call infrastructure.