refactor blob envelope logic into one class