Change Code structure to dict and store type info