Simplify validation
diff --git a/cmd/termmapper/fuzz_test.go b/cmd/termmapper/fuzz_test.go
index 6727b5c..8d63d53 100644
--- a/cmd/termmapper/fuzz_test.go
+++ b/cmd/termmapper/fuzz_test.go
@@ -193,7 +193,7 @@
 			direction:     "atob",
 			input:         "{}",
 			expectedCode:  http.StatusBadRequest,
-			expectedError: "map ID too long (max 1024 bytes)",
+			expectedError: "mapID too long (max 1024 bytes)",
 		},
 		{
 			name:          "Large direction",
@@ -201,7 +201,7 @@
 			direction:     strings.Repeat("a", maxParamLength+1),
 			input:         "{}",
 			expectedCode:  http.StatusBadRequest,
-			expectedError: "direction too long (max 1024 bytes)",
+			expectedError: "dir too long (max 1024 bytes)",
 		},
 		{
 			name:          "Large foundryA",
diff --git a/cmd/termmapper/main.go b/cmd/termmapper/main.go
index 0f619c1..664471d 100644
--- a/cmd/termmapper/main.go
+++ b/cmd/termmapper/main.go
@@ -161,31 +161,8 @@
 
 // validateInput checks if the input parameters are valid
 func validateInput(mapID, dir, foundryA, foundryB, layerA, layerB string, body []byte) error {
-	// Check input lengths
-	if len(mapID) > maxParamLength {
-		return fmt.Errorf("map ID too long (max %d bytes)", maxParamLength)
-	}
-	if len(dir) > maxParamLength {
-		return fmt.Errorf("direction too long (max %d bytes)", maxParamLength)
-	}
-	if len(foundryA) > maxParamLength {
-		return fmt.Errorf("foundryA too long (max %d bytes)", maxParamLength)
-	}
-	if len(foundryB) > maxParamLength {
-		return fmt.Errorf("foundryB too long (max %d bytes)", maxParamLength)
-	}
-	if len(layerA) > maxParamLength {
-		return fmt.Errorf("layerA too long (max %d bytes)", maxParamLength)
-	}
-	if len(layerB) > maxParamLength {
-		return fmt.Errorf("layerB too long (max %d bytes)", maxParamLength)
-	}
-	if len(body) > maxInputLength {
-		return fmt.Errorf("request body too large (max %d bytes)", maxInputLength)
-	}
-
-	// Check for invalid characters in parameters
-	for _, param := range []struct {
+	// Define parameter checks
+	params := []struct {
 		name  string
 		value string
 	}{
@@ -195,11 +172,22 @@
 		{"foundryB", foundryB},
 		{"layerA", layerA},
 		{"layerB", layerB},
-	} {
+	}
+
+	for _, param := range params {
+		// Check input lengths
+		if len(param.value) > maxParamLength {
+			return fmt.Errorf("%s too long (max %d bytes)", param.name, maxParamLength)
+		}
+		// Check for invalid characters in parameters
 		if strings.ContainsAny(param.value, "<>{}[]\\") {
 			return fmt.Errorf("%s contains invalid characters", param.name)
 		}
 	}
 
+	if len(body) > maxInputLength {
+		return fmt.Errorf("request body too large (max %d bytes)", maxInputLength)
+	}
+
 	return nil
 }