diff --git a/common/src/main/java/dev/openrs2/common/StringUtils.kt b/common/src/main/java/dev/openrs2/common/StringUtils.kt
index 77d87971a9..66eb145854 100644
--- a/common/src/main/java/dev/openrs2/common/StringUtils.kt
+++ b/common/src/main/java/dev/openrs2/common/StringUtils.kt
@@ -3,8 +3,7 @@ package dev.openrs2.common
 fun CharSequence.indefiniteArticle(): String {
     require(isNotEmpty())
 
-    val first = first().toLowerCase()
-    return when (first) {
+    return when (first().toLowerCase()) {
         'a', 'e', 'i', 'o', 'u' -> "an"
         else -> "a"
     }
diff --git a/common/src/main/java/dev/openrs2/common/collect/ForestDisjointSet.kt b/common/src/main/java/dev/openrs2/common/collect/ForestDisjointSet.kt
index f16f5e4535..66ff3b7d0c 100644
--- a/common/src/main/java/dev/openrs2/common/collect/ForestDisjointSet.kt
+++ b/common/src/main/java/dev/openrs2/common/collect/ForestDisjointSet.kt
@@ -98,13 +98,17 @@ class ForestDisjointSet<T> : DisjointSet<T> {
             return
         }
 
-        if (xRoot.rank < yRoot.rank) {
-            xRoot.parent = yRoot
-        } else if (xRoot.rank > yRoot.rank) {
-            yRoot.parent = xRoot
-        } else {
-            yRoot.parent = xRoot
-            xRoot.rank++
+        when {
+            xRoot.rank < yRoot.rank -> {
+                xRoot.parent = yRoot
+            }
+            xRoot.rank > yRoot.rank -> {
+                yRoot.parent = xRoot
+            }
+            else -> {
+                yRoot.parent = xRoot
+                xRoot.rank++
+            }
         }
 
         partitions--
diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/IfElseTransformer.kt b/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/IfElseTransformer.kt
index 8e2f47481e..a02b7a121c 100644
--- a/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/IfElseTransformer.kt
+++ b/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/IfElseTransformer.kt
@@ -115,13 +115,13 @@ class IfElseTransformer : Transformer() {
 
     companion object {
         private fun isIf(stmt: Statement): Boolean {
-            return if (stmt.isIfStmt) {
-                true
-            } else if (stmt.isBlockStmt) {
-                val stmts = stmt.asBlockStmt().statements
-                stmts.size == 1 && stmts[0].isIfStmt
-            } else {
-                false
+            return when {
+                stmt.isIfStmt -> true
+                stmt.isBlockStmt -> {
+                    val stmts = stmt.asBlockStmt().statements
+                    stmts.size == 1 && stmts[0].isIfStmt
+                }
+                else -> false
             }
         }
 
diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.kt b/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.kt
index 3d6c34f305..3b44aa872e 100644
--- a/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.kt
+++ b/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.kt
@@ -12,7 +12,7 @@ fun Expression.isIntegerOrLongLiteral(): Boolean {
 }
 
 fun createLong(value: Long): LongLiteralExpr {
-    return LongLiteralExpr(java.lang.Long.toString(value) + "L")
+    return LongLiteralExpr(value.toString() + "L")
 }
 
 fun Expression.negate(): Expression {
diff --git a/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.kt
index 846072659c..aebad54b44 100644
--- a/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.kt
+++ b/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.kt
@@ -39,13 +39,13 @@ class OpaquePredicateTransformer : Transformer() {
     }
 
     private fun findFlowObstructors(library: Library, method: MethodNode) {
-        FLOW_OBSTRUCTOR_INITIALIZER_MATCHER.match(method).forEach {
+        FLOW_OBSTRUCTOR_INITIALIZER_MATCHER.match(method).forEach { match ->
             // add flow obstructor to set
-            val putstatic = it.last() as FieldInsnNode
+            val putstatic = match.last() as FieldInsnNode
             flowObstructors.add(MemberRef(putstatic))
 
             // remove initializer
-            it.forEach(method.instructions::remove)
+            match.forEach(method.instructions::remove)
 
             // remove field
             val owner = library[putstatic.owner]!!
diff --git a/deob/src/main/java/dev/openrs2/deob/transform/UnusedArgTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/UnusedArgTransformer.kt
index a6e1d86e5d..8d4d6183d9 100644
--- a/deob/src/main/java/dev/openrs2/deob/transform/UnusedArgTransformer.kt
+++ b/deob/src/main/java/dev/openrs2/deob/transform/UnusedArgTransformer.kt
@@ -56,8 +56,7 @@ class UnusedArgTransformer : Transformer() {
 
             val stackSize = frame.stackSize
 
-            val insn = method.instructions[i]
-            when (insn) {
+            when (val insn = method.instructions[i]) {
                 is VarInsnNode -> {
                     if (insn.opcode != Opcodes.ILOAD) {
                         continue@frame