private Statement[] visit(Statement[] stmts) {
            int length = stmts.length;

            Collection<Statement> statements = new ArrayList<Statement>();
            List<ExpressionStatement> expressionStatements =
                new ArrayList<ExpressionStatement>();

            for (int i=0; i<length; i++) {
                Statement stmt = stmts[i];
                if (stmt instanceof ExpressionStatement) {
                    Expression expr =
                        ((ExpressionStatement)stmt).getExpression();

                    if (!(expr instanceof CallExpression)) {
                        expressionStatements.add((ExpressionStatement) stmt);
                        continue;
                    }
                }

                merge(statements, expressionStatements);
                expressionStatements.clear();
                statements.add(stmt);
            }

            merge(statements, expressionStatements);

            stmts = new Statement[statements.size()];
            return statements.toArray(stmts);
        }