netcp: code refactor