diff --git a/src/mscash2_fmt.c b/src/mscash2_fmt.c
index b4150a8..32f4de0 100644
--- a/src/mscash2_fmt.c
+++ b/src/mscash2_fmt.c
@@ -188,27 +188,17 @@ static int valid(char *ciphertext, struct fmt_main *pFmt)
 	unsigned int i;
 	unsigned int l;
 
-	/*
-	* 2 cases
-	* 1 - it comes from the disk, and does not have M$ + salt
-	* 2 - it comes from memory, and has got M$ + salt + # + blah
-	*/
+	if (strncmp(ciphertext, "M$", 2))
+		return 0;
+
+	l = strlen(ciphertext);
+	if (l <= 32 || l > MAX_CIPHERTEXT_LENGTH)
+		return 0;
+
+	l -= 32;
+	if(ciphertext[l-1]!='#')
+		return 0;
 
-	if (!strncmp(ciphertext, "M$", 2))
-	{
-		l = strlen(ciphertext);
-		if (l <= 32 || l > MAX_CIPHERTEXT_LENGTH)
-			return 0;
-		l -= 32;
-		if (ciphertext[l - 1] != '#')
-			return 0;
-	}
-	else
-	{
-		if (strlen(ciphertext) != 32)
-			return 0;
-		l = 0;
-	}
 	for (i = l; i < l + 32; i++)
 		if (atoi16[ARCH_INDEX(ciphertext[i])] == 0x7F)
 			return 0;
diff --git a/src/mscash_fmt.c b/src/mscash_fmt.c
index 9d20f90..0dddcb3 100644
--- a/src/mscash_fmt.c
+++ b/src/mscash_fmt.c
@@ -149,27 +149,17 @@ static int valid(char *ciphertext, struct fmt_main *pFmt)
 	unsigned int i;
 	unsigned int l;
 
-	/*
-	* 2 cases
-	* 1 - it comes from the disk, and does not have M$ + salt
-	* 2 - it comes from memory, and has got M$ + salt + # + blah
-	*/
+	if (strncmp(ciphertext, "M$", 2))
+		return 0;
+
+	l = strlen(ciphertext);
+	if (l <= 32 || l > MAX_CIPHERTEXT_LENGTH)
+		return 0;
+
+	l -= 32;
+	if(ciphertext[l-1]!='#')
+		return 0;
 
-	if (!strncmp(ciphertext, "M$", 2))
-	{
-		l = strlen(ciphertext);
-		if (l <= 32 || l > MAX_CIPHERTEXT_LENGTH)
-			return 0;
-		l -= 32;
-		if(ciphertext[l-1]!='#')
-			return 0;
-	}
-	else
-	{
-		if(strlen(ciphertext)!=32)
-			return 0;
-		l = 0;
-	}
 	for (i = l; i < l + 32; i++)
 		if (atoi16[ARCH_INDEX(ciphertext[i])] == 0x7F)
 			return 0;
