@Override
    public String process(String code) {

        // filter comments, chars and strings
        FilterComments fC = new FilterComments();
        code = fC.process(code);
//        FilterChars fCh = new FilterChars();
//        code = fCh.process(code);
//        FilterStrings fS = new FilterStrings();
//        code = fS.process(code);

        StringBuilder result = new StringBuilder();

        String[] lines = code.split("\n");

        boolean insideOfClassImplementation = false;
        int blockCount = 0;


        for (String l : lines) {

            if (!insideOfClassImplementation
                    && Patterns.TEMPLATE_CLS_HEADER.matcher(l).find()) {
                insideOfClassImplementation = 
                        LangUtils.classNameFromTemplateClsHeader(l).
                        equals(clazz.getName());
            }

            if (insideOfClassImplementation) {
                for (int i = 0; i < l.length(); i++) {

                    char ch = l.charAt(i);

                    if (ch=='{') {
                        blockCount++;
                    }
                    
                    if (ch=='}') {
                        blockCount--;
                    }
                }

                if (insideOfClassImplementation) {
                    result.append(l).append("\n");
                }

                if (blockCount == 0) {
                    break;
                }
            }
        }

        return result.toString();
    }