split packet parsing into its own library