Refactored the packet printing