Refining network code