@SuppressWarnings("rawtypes")
    private List<Rule> extractRules(Object rawConfig, String sectionName) {
        if (!((Map) rawConfig).containsKey(sectionName))
            return new ArrayList<Rule>();
        ArrayList list = (ArrayList) ((LinkedHashMap) rawConfig)
                .get(sectionName);

        List<Rule> rules = new ArrayList<Rule>();
        for (Object item : list) {
            LinkedHashMap info = (LinkedHashMap) item;

            // TODO: REMEMBER to remove these ugly duplications.
            Map<String, ACTION> mapper = getActionMapper();
            String actionString = info.get("Action").toString();

            // TODO: CHANGE this to exception
            ACTION action = mapper.get(actionString);
            assert action != null;
            Rule rule = new Rule(action);

            if (info.containsKey("Src"))
                rule.setSrc(info.get("Src").toString());
            if (info.containsKey("Dest"))
                rule.setDest(info.get("Dest").toString());
            if (info.containsKey("Kind"))
                rule.setKind(info.get("Kind").toString());

            if (info.containsKey("ID"))
                rule.setID(((Integer) info.get("ID")).intValue());
            if (info.containsKey("Nth"))
                rule.setNth(((Integer) info.get("Nth")).intValue());

            rules.add(rule);
        }
        return rules;
    }