Index: java/main/src/main/java/com/framsticks/parsers/Schema.java
===================================================================
--- java/main/src/main/java/com/framsticks/parsers/Schema.java	(revision 77)
+++ java/main/src/main/java/com/framsticks/parsers/Schema.java	(revision 78)
@@ -1,4 +1,6 @@
 package com.framsticks.parsers;
 
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -8,7 +10,7 @@
 import java.util.Map.Entry;
 
-import com.framsticks.params.FramsClass;
-import com.framsticks.params.Param;
+import com.framsticks.params.*;
 import com.framsticks.params.types.DecimalParam;
+import com.framsticks.params.types.FloatParam;
 import com.framsticks.params.types.StringParam;
 import org.apache.log4j.Logger;
@@ -19,6 +21,4 @@
 
 import com.framsticks.leftovers.f0.NeuroClass;
-import com.framsticks.params.Group;
-import com.framsticks.params.ParamBuilder;
 import org.w3c.dom.Document;
 import org.w3c.dom.NamedNodeMap;
@@ -39,21 +39,12 @@
 	private final static Logger logger = Logger.getLogger(Schema.class);
 
-	/** The main classes (such as part, joint, etc.) */
-	private Map<String, FramsClass> mainClasses = new HashMap<String, FramsClass>();
+	protected final Registry registry = new Registry();
 
 	/** The neuro classes (classess representing different types of neurons). */
 	private Map<String, NeuroClass> neuroClasses = new HashMap<String, NeuroClass>();
 
-	// TODO: definition can be changed
-	/**
-	 * Instantiates a new schema with usage of f0def.xml file stored in
-	 * resources.
-	 * 
-	 * @throws Exception
-	 *             the exception if one occured while reading the stream
-	 */
-	public Schema() throws Exception {
-		this(Thread.currentThread().getContextClassLoader()
-				.getResourceAsStream("f0def.xml"));
+	public static InputStream getDefaultDefinitionAsStream() {
+		//return new FileInputStream(new File(Schema.class.getResource("/parsers/f0def.xml").getPath()));
+		return Schema.class.getResourceAsStream("/parsers/f0def.xml");
 	}
 
@@ -61,10 +52,10 @@
 	 * Instantiates a new schema.
 	 * 
-	 * @param xmlStream
+	 * @param inputStream
 	 *            the xml stream with schema
 	 * @throws Exception
-	 *             the exception if one occured while reading the stream
-	 */
-	public Schema(InputStream xmlStream) throws Exception {
+	 *             the exception if one occurred while reading the stream
+	 */
+	public Schema(InputStream inputStream) throws Exception {
 
 		DocumentBuilderFactory factory;
@@ -75,5 +66,5 @@
 			db = factory.newDocumentBuilder();
 
-			Document document = db.parse(xmlStream);
+			Document document = db.parse(inputStream);
 			NodeList classes = document.getElementsByTagName("CLASS");
 
@@ -81,5 +72,5 @@
 				Node classNode = classes.item(i);
 				FramsClass framsClass = processClass(classNode);
-				mainClasses.put(framsClass.getId(), framsClass);
+				registry.putInfoIntoCache(framsClass);
 			}
 
@@ -106,5 +97,5 @@
 							symbolGlymph[j] = Integer.parseInt(sgha[j]);
 						} catch (NumberFormatException e) {
-							logger.error("an error occured while parsing symbol glymph, class getId: "
+							logger.error("an error occurred while parsing symbol glymph, class getId: "
 									+ framsClass.getId()
 									+ ", glymph offset: " + j);
@@ -119,11 +110,11 @@
 
 		} catch (IOException e) {
-			logger.fatal("unexpected exception occured: ", e);
+			logger.fatal("unexpected exception occurred: ", e);
 			throw e;
 		} catch (ParserConfigurationException e) {
-			logger.fatal("unexpected exception occured: ", e);
+			logger.fatal("unexpected exception occurred: ", e);
 			throw e;
 		} catch (SAXException e) {
-			logger.fatal("unexpected exception occured: ", e);
+			logger.fatal("unexpected exception occurred: ", e);
 			throw e;
 		}
@@ -140,11 +131,15 @@
 	 */
 	private static int getIntAttribute(NamedNodeMap attributes, String name) {
+		String v = getAttribute(attributes, name);
+		if (v == null) {
+			return 0;
+		}
 		try {
-			return Integer.parseInt(getAttribute(attributes, name));
+			return Integer.parseInt(v);
 		} catch (NullPointerException e) {
 			return 0;
 		} catch (NumberFormatException e) {
 			logger.fatal("attribute " + name
-					+ " should be numeric (it is not)");
+					+ " should be numeric: " + v);
 			return 0;
 		}
@@ -186,5 +181,5 @@
 	 *             the exception in case of any error
 	 */
-	private FramsClass processClass(Node classNode) throws Exception {
+	private static FramsClass processClass(Node classNode) throws Exception {
 		String classId = null;
 		String className = "";
@@ -200,6 +195,5 @@
 		classDescription = getAttributeFromNode("DESCRIPTION", classNode);
 
-		FramsClass framsClass = new FramsClass(classId, className,
-				classDescription);
+		FramsClass framsClass = new FramsClass(classId, className, classDescription);
 
 		NodeList classProperties = classNode.getChildNodes();
@@ -210,12 +204,11 @@
 			if ("GROUP".equals(node.getNodeName())) {
 				NamedNodeMap attributes = node.getAttributes();
-				String name = attributes.getNamedItem("NAME") == null ? null
-						: attributes.getNamedItem("NAME").getNodeValue();
-				if (name == null)
-					logger.warn("Group getName in class \"" + classId + "\" ("
+				String name = getAttribute(attributes, "NAME");
+				if (name == null) {
+					logger.warn("Group name in class \"" + classId + "\" ("
 							+ className + ") is undefined");
-				else
+				} else {
 					framsClass.appendGroup(new Group(name));
-
+				}
 			} else if ("PROP".equals(node.getNodeName())
 					|| "NEUROPROP".equals(node.getNodeName())) {
@@ -232,5 +225,5 @@
 
 	/**
-	 * It analyses the single property within the clas
+	 * It analyses the single property within the class
 	 * 
 	 * @param attributes
@@ -242,5 +235,5 @@
 	 *             the exception in case of any error
 	 */
-	private Param processParameter(NamedNodeMap attributes, String classId)
+	private static Param processParameter(NamedNodeMap attributes, String classId)
 			throws Exception {
 
@@ -315,5 +308,5 @@
 				}
 			}
-			builder.setType(DecimalParam.class);
+			builder.setType(FloatParam.class);
 			builder.setMin(minMaxDefDouble.get("MIN"));
 			builder.setMax(minMaxDefDouble.get("MAX"));
@@ -330,7 +323,4 @@
 	}
 
-	public Map<String, FramsClass> getMainClasses() {
-		return Collections.unmodifiableMap(mainClasses);
-	}
 
 	public Map<String, NeuroClass> getNeuroClasses() {
@@ -338,3 +328,8 @@
 	}
 
+	public final Registry getRegistry() {
+		return registry;
+	}
+
+
 }
