Update packet encode functionality