diff --git a/tools/android/webgpu/src/androidTest/java/net/android/dawn/ImageTest.kt b/tools/android/webgpu/src/androidTest/java/net/android/dawn/ImageTest.kt
index f7f8847..08233f4 100644
--- a/tools/android/webgpu/src/androidTest/java/net/android/dawn/ImageTest.kt
+++ b/tools/android/webgpu/src/androidTest/java/net/android/dawn/ImageTest.kt
@@ -3,8 +3,8 @@
 import android.dawn.*
 import android.dawn.helper.DawnException
 import android.dawn.helper.Util
-import android.dawn.helper.createImageFromGpuTexture
-import android.dawn.helper.streamToString
+import android.dawn.helper.asString
+import android.dawn.helper.createBitmap
 import android.graphics.Bitmap
 import android.graphics.BitmapFactory
 import android.os.Environment
@@ -66,7 +66,7 @@
             val shaderModule = device.createShaderModule(
                 ShaderModuleDescriptor(
                     shaderModuleWGSLDescriptor = ShaderModuleWGSLDescriptor(
-                        code = streamToString(appContext.assets.open("triangle/shader.wgsl"))
+                        code = appContext.assets.open("triangle/shader.wgsl").asString()
                     )
                 )
             )
@@ -121,7 +121,7 @@
                 })
             }
 
-            val bitmap = createImageFromGpuTexture(device, testTexture)
+            val bitmap = testTexture.createBitmap(device)
 
             if (false) {
                 writeReferenceImage(bitmap)
diff --git a/tools/android/webgpu/src/main/java/android/dawn/helper/Streams.kt b/tools/android/webgpu/src/main/java/android/dawn/helper/Streams.kt
index 4a52b54..8cb01b0 100644
--- a/tools/android/webgpu/src/main/java/android/dawn/helper/Streams.kt
+++ b/tools/android/webgpu/src/main/java/android/dawn/helper/Streams.kt
@@ -5,13 +5,8 @@
 import java.nio.charset.StandardCharsets
 import java.util.Scanner
 
-fun streamToString(inputStream: InputStream): String {
-    val scanner = Scanner(
-        InputStreamReader(
-            inputStream,
-            StandardCharsets.UTF_8
-        )
-    ).useDelimiter("\\A")
-    return if (scanner.hasNext()) scanner.next() else ""
-}
+fun InputStream.asString(): String =
+    Scanner(InputStreamReader(this, StandardCharsets.UTF_8)).useDelimiter("\\A").run {
+        if (hasNext()) next() else ""
+    }
 
diff --git a/tools/android/webgpu/src/main/java/android/dawn/helper/Textures.kt b/tools/android/webgpu/src/main/java/android/dawn/helper/Textures.kt
index be518b5..5c9cc38 100644
--- a/tools/android/webgpu/src/main/java/android/dawn/helper/Textures.kt
+++ b/tools/android/webgpu/src/main/java/android/dawn/helper/Textures.kt
@@ -4,8 +4,8 @@
 import android.graphics.Bitmap
 import java.nio.ByteBuffer
 
-fun createGpuTextureFromBitmap(device: Device, bitmap: Bitmap): Texture {
-    val size = Extent3D(width = bitmap.width, height = bitmap.height)
+fun Bitmap.createGpuTexture(device: Device): Texture {
+    val size = Extent3D(width = width, height = height)
     return device.createTexture(
         TextureDescriptor(
             size = size,
@@ -14,13 +14,12 @@
                     TextureUsage.RenderAttachment
         )
     ).also { texture ->
-        ByteBuffer.allocateDirect(bitmap.height * bitmap.width * Int.SIZE_BYTES).let { pixels ->
-            bitmap.copyPixelsToBuffer(pixels)
+        ByteBuffer.allocateDirect(height * width * Int.SIZE_BYTES).let { pixels ->
+            copyPixelsToBuffer(pixels)
             device.queue.writeTexture(
                 dataLayout = TextureDataLayout(
-
-                    bytesPerRow = bitmap.width * Int.SIZE_BYTES,
-                    rowsPerImage = bitmap.height
+                    bytesPerRow = width * Int.SIZE_BYTES,
+                    rowsPerImage = height
                 ),
                 data = pixels,
                 destination = ImageCopyTexture(texture = texture),
@@ -30,36 +29,36 @@
     }
 }
 
-suspend fun createImageFromGpuTexture(device: Device, texture: Texture): Bitmap {
-    if (texture.width % 64 > 0) {
-        throw DawnException("Texture must be a multiple of 64. Was ${texture.width}")
+suspend fun Texture.createBitmap(device: Device): Bitmap {
+    if (width % 64 > 0) {
+        throw DawnException("Texture must be a multiple of 64. Was ${width}")
     }
 
-    val size = texture.width * texture.height * Int.SIZE_BYTES
+    val size = width * height * Int.SIZE_BYTES
     val readbackBuffer = device.createBuffer(
         BufferDescriptor(
             size = size.toLong(),
             usage = BufferUsage.CopyDst or BufferUsage.MapRead
         )
     )
-    device.queue.submit(arrayOf(device.createCommandEncoder().run {
-        copyTextureToBuffer(
-            source = ImageCopyTexture(texture = texture),
+    device.queue.submit(arrayOf(device.createCommandEncoder().let {
+        it.copyTextureToBuffer(
+            source = ImageCopyTexture(texture = this),
             destination = ImageCopyBuffer(
                 layout = TextureDataLayout(
                     offset = 0,
-                    bytesPerRow = texture.width * Int.SIZE_BYTES,
-                    rowsPerImage = texture.height
+                    bytesPerRow = width * Int.SIZE_BYTES,
+                    rowsPerImage = height
                 ), buffer = readbackBuffer
             ),
-            copySize = Extent3D(width = texture.width, height = texture.height)
+            copySize = Extent3D(width = width, height = height)
         )
-        finish()
+        it.finish()
     }))
 
     readbackBuffer.mapAsync(MapMode.Read, 0, size.toLong())
 
-    return Bitmap.createBitmap(texture.width, texture.height, Bitmap.Config.ARGB_8888).apply {
+    return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).apply {
         copyPixelsFromBuffer(readbackBuffer.getConstMappedRange(size = readbackBuffer.size))
         readbackBuffer.unmap()
     }
