change via to ref, reorganize how the packet processing is described