diff --git a/src/art/artJS.tw b/src/art/artJS.tw
index e1ff061cf4618d2036959bf657cf932752a36a94..3fd402dbf3c2f8868f11d348f911405b96ce0cb1 100644
--- a/src/art/artJS.tw
+++ b/src/art/artJS.tw
@@ -2723,3 +2723,88 @@ window.ArtVectorLeg = function(slave) {
 	State.temporary.legSize = legSize;
 	return r;
 };
+
+window.ArtVectorHairBack = function(slave) {
+	let r = "";
+	let hairLength;
+
+	if (slave.hLength >= 60)
+		hairLength = "Long";
+	else if (slave.hLength >= 30)
+		hairLength = "Medium";
+	else if (slave.hLength >= 10)
+		hairLength = "Short";
+
+	if (slave.fuckdoll !== 0 || slave.bald !== 0) {
+		r += jsInclude("Art_Vector_Hair_Back_NoHair");
+	} else {
+		switch (slave.clothes) {
+			case "a biyelgee costume":
+			case "a burkini":
+			case "a burqa":
+			case "a chattel habit":
+			case "a cybersuit":
+			case "a fallen nuns habit":
+			case "a hijab and abaya":
+			case "a hijab and blouse":
+			case "a klan robe":
+			case "a military uniform":
+			case "a mounty outfit":
+			case "a niqab and abaya":
+			case "a penitent nuns habit":
+			case "a police uniform":
+			case "a red army uniform":
+			case "a schutzstaffel uniform":
+			case "a slutty klan robe":
+			case "a slutty nurse outfit":
+			case "a slutty schutzstaffel uniform":
+			case "battlearmor":
+			case "restrictive latex":
+			case "Western clothing":
+				break; /* do nothing */
+			default:
+				switch (slave.hStyle) {
+					case "buzzcut":
+					case "shaved":
+					case "shaved bald":
+						r += jsInclude("Art_Vector_Hair_Back_NoHair");
+						break;
+					case "afro":
+						if (slave.hLength >= 150)
+							r += jsInclude("Art_Vector_Hair_Back_Afro_Giant");
+						else
+							r += jsInclude(`Art_Vector_Hair_Back_Afro_${hairLength}`);
+						break;
+					case "messy bun":
+						r += jsInclude(`Art_Vector_Hair_Back_Ninja_${hairLength}`);
+						break;
+					case "strip":
+						if (slave.hLength >= 0)
+							r += jsInclude("Art_Vector_Hair_Back_NoHair");
+						break;
+					case "braided":
+					case "bun":
+					case "cornrows":
+					case "curled":
+					case "dreadlocks":
+					case "eary":
+					case "luxurious":
+					case "messy":
+					case "neat":
+					case "permed":
+					case "ponytail":
+					case "tails":
+					case "up":
+						if (hairLength)
+							r += jsInclude(`Art_Vector_Hair_Back_${capFirstChar(slave.hStyle)}_${hairLength}`);
+						break;
+					default:
+						r += jsInclude("Art_Vector_Hair_Back_Messy_Medium");
+				}
+		}
+	}
+	/* note: latex clothing actually shows some hair, but there is no appropriate art for it */
+	if (slave.collar === "cat ears")
+		r += jsInclude("Art_Vector_Cat_Ear_Back");
+	return r;
+};
diff --git a/src/art/vector/Hair_Back.tw b/src/art/vector/Hair_Back.tw
index 0c3f674d183ef67a8d761c875895a8c3dccff091..a80932168bb681e4ecb71f6652a9d68e4e1e14ee 100644
--- a/src/art/vector/Hair_Back.tw
+++ b/src/art/vector/Hair_Back.tw
@@ -1,146 +1,3 @@
 :: Art_Vector_Hair_Back_ [nobr]
 
-<<if _artSlave.fuckdoll != 0 || _artSlave.bald != 0>>
-	<<include Art_Vector_Hair_Back_NoHair>>
-<<else>>
-	<<if _artSlave.clothes != "restrictive latex" && _artSlave.clothes != "a hijab and abaya" && _artSlave.clothes != "a chattel habit" && _artSlave.clothes != "a fallen nuns habit" && _artSlave.clothes != "a penitent nuns habit" && _artSlave.clothes != "a cybersuit" && _artSlave.clothes != "Western clothing" && _artSlave.clothes != "a military uniform" && _artSlave.clothes != "a schutzstaffel uniform" && _artSlave.clothes != "a slutty schutzstaffel uniform" && _artSlave.clothes != "a red army uniform" && _artSlave.clothes != "battlearmor" && _artSlave.clothes != "a biyelgee costume" && _artSlave.clothes != "a mounty outfit" && _artSlave.clothes != "a slutty nurse outfit" && _artSlave.clothes != "a niqab and abaya" && _artSlave.clothes != "a burqa" && _artSlave.clothes != "a klan robe" && _artSlave.clothes != "a hijab and blouse" && _artSlave.clothes != "a burkini" && _artSlave.clothes != "a slutty klan robe" && _artSlave.clothes != "a police uniform">>
-		<<switch _artSlave.hStyle>>
-		<<case "buzzcut" "shaved" "shaved bald">>
-			<<include Art_Vector_Hair_Back_NoHair>>
-		<<case "strip">>
-			<<if _artSlave.hLength >=0>>
-				<<include Art_Vector_Hair_Back_NoHair>>
-			<</if>>
-		<<case "permed">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Permed_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Permed_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Permed_Short>>
-			<</if>>
-		<<case "up">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Up_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Up_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Up_Short>>
-			<</if>>
-		<<case "neat">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Neat_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Neat_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Neat_Short>>
-			<</if>>
-		<<case "ponytail">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Ponytail_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Ponytail_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Ponytail_Short>>
-			<</if>>
-		<<case "bun">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Bun_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Bun_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Bun_Short>>
-			<</if>>
-		<<case "curled">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Curled_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Curled_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Curled_Short>>
-			<</if>>
-		<<case "eary">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Eary_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Eary_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Eary_Short>>
-			<</if>>
-		<<case "luxurious">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Luxurious_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Luxurious_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Luxurious_Short>>
-			<</if>>
-		<<case "afro">>
-			<<if _artSlave.hLength >= 150>>
-				<<include Art_Vector_Hair_Back_Afro_Giant>>
-			<<elseif _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Afro_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Afro_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Afro_Short>>
-			<</if>>
-		<<case "messy">> /* this isn't an option in salon.tw. What should it be? */
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Messy_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Messy_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Messy_Short>>
-			<</if>>
-		<<case "dreadlocks">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Dreadlocks_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Dreadlocks_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Dreadlocks_Short>>
-			<</if>>
-		<<case "cornrows">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Cornrows_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Cornrows_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Cornrows_Short>>
-			<</if>>
-		<<case "braided">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Braided_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Braided_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Braided_Short>>
-			<</if>>
-		<<case "tails">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Tails_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Tails_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Tails_Short>>
-			<</if>>
-		<<case "messy bun">>
-			<<if _artSlave.hLength >= 60>>
-				<<include Art_Vector_Hair_Back_Ninja_Long>>
-			<<elseif _artSlave.hLength >= 30>>
-				<<include Art_Vector_Hair_Back_Ninja_Medium>>
-			<<elseif _artSlave.hLength >= 10>>
-				<<include Art_Vector_Hair_Back_Ninja_Short>>
-			<</if>>
-		<<default>>
-			<<include Art_Vector_Hair_Back_Messy_Medium>>
-		<</switch>>
-	<</if>>
-<</if>>
-
-/* note: latex clothing actually shows some hair, but there is no appropriate art for it */
-
-<<if _artSlave.collar == "cat ears">>
-	<<include Art_Vector_Cat_Ear_Back>>
-<</if>>
\ No newline at end of file
+<<= ArtVectorHairBack(_artSlave)>>