diff --git a/src/analysis.cpp b/src/analysis.cpp
index 5524c3f..16ed260 100644
--- a/src/analysis.cpp
+++ b/src/analysis.cpp
@@ -48,15 +48,6 @@ bool is_arithmetic_type(Type type) {
     }
 }
 
-Type string_to_type(string s, CodePosition pos) {
-    if (s == "int")
-        return Type::Int;
-    if (s == "double")
-        return Type::Double;
-    
-    throw TypeError("Unknown type", pos);
-}
-
 AnalysisResult analyze(Node &ast, Memory &memory) {
     if (holds_alternative<Token>(ast)) {
         Token token = get<Token>(ast);
diff --git a/src/include/types.h b/src/include/types.h
index 8f9f1c0..b7fa25b 100644
--- a/src/include/types.h
+++ b/src/include/types.h
@@ -12,7 +12,7 @@ using namespace std;
 /**
  * Tokens definition
 */
-enum class TokenType { Type, Identifier, Litteral, Plus, Minus, DoublePlus, DoubleMinus, DoubleEqual, Land, Lor, Lt, Gt, Leq, Geq, NotEqual, Not, Star, Slash, Percent, Equal, Semicolon, LParenthese, RParenthese, LCurlyBracket, RCurlyBracket, If, Else, While, For, Comma };
+enum class TokenType { Identifier, Litteral, Plus, Minus, DoublePlus, DoubleMinus, DoubleEqual, Land, Lor, Lt, Gt, Leq, Geq, NotEqual, Not, Star, Slash, Percent, Equal, Semicolon, LParenthese, RParenthese, LCurlyBracket, RCurlyBracket, If, Else, While, For, Comma };
 enum class Type { Int, Double };
 
 using TokenData = variant<int, double, string, Type>;
diff --git a/src/include/utils.h b/src/include/utils.h
index d318134..b55702e 100644
--- a/src/include/utils.h
+++ b/src/include/utils.h
@@ -9,4 +9,9 @@ using namespace std;
 */
 CodePosition get_node_pos(Node node);
 
+/**
+ * Returns the Type associated with a type name
+*/
+Type string_to_type(string type_name);
+
 #endif
\ No newline at end of file
diff --git a/src/interpreter.cpp b/src/interpreter.cpp
index 452b1d5..a8c7b5b 100644
--- a/src/interpreter.cpp
+++ b/src/interpreter.cpp
@@ -4,6 +4,7 @@
 #include "include/parser.h"
 #include "include/interpreter.h"
 #include "include/memory.h"
+#include "include/utils.h"
 using namespace std;
 
 bool bool_cast(EvalResult value) {
@@ -253,21 +254,23 @@ EvalResult eval(Node &ast, Memory &memory) {
             case NodeType::Declaration: {
                 Token typeTok = get<Token>(node.children[0]);
                 Token identifierTok = get<Token>(node.children[1]);
-                Type type = get<Type>(typeTok.data);
+                string typeName = get<string>(typeTok.data);
                 string identifier = get<string>(identifierTok.data);
 
-                memory.declare(identifier, type);
+                memory.declare(identifier, string_to_type(typeName));
                 
                 return {};
             } break;
             case NodeType::AssignedDeclaration: {
                 Token typeTok = get<Token>(node.children[0]);
                 Token identifierTok = get<Token>(node.children[1]);
-                Type type = get<Type>(typeTok.data);
+                string typeName = get<string>(typeTok.data);
                 string identifier = get<string>(identifierTok.data);
                 EvalResult value = eval(node.children[2], memory);
 
+                Type type = string_to_type(typeName);
                 memory.declare(identifier, type);
+                
                 if (type == Type::Int) {
                     memory.update(identifier, int_cast(value));
                 }
diff --git a/src/tokenize.cpp b/src/tokenize.cpp
index 468054b..257f4b9 100644
--- a/src/tokenize.cpp
+++ b/src/tokenize.cpp
@@ -94,9 +94,6 @@ void _debug_print_token(Token token) {
         case TokenType::Identifier:
             cout << "Identifier(" << get<string>(token.data) << ")";
         break;
-        case TokenType::Type:
-            cout << "Type("+_debug_get_type_name(get<Type>(token.data))+")";
-        break;
         case TokenType::Plus:
             cout << "+";
         break;
diff --git a/src/utils.cpp b/src/utils.cpp
index 641f442..6223ceb 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -4,4 +4,13 @@ CodePosition get_node_pos(Node node) {
     if (holds_alternative<InnerNode>(node))
         return get<InnerNode>(node).pos;
     return get<Token>(node).pos;
+}
+
+Type string_to_type(string type_name) {
+    if (type_name == "int")
+        return Type::Int;
+    if (type_name == "double")
+        return Type::Double;
+    
+    throw;
 }
\ No newline at end of file