diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/api/ClusterInfo.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/api/ClusterInfo.java
deleted file mode 100644
index d996e0e..0000000
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/api/ClusterInfo.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.event.api;
-
-import java.util.List;
-
-public class ClusterInfo {
-
-    List<NodeInfo> nodes;
-
-    public ClusterInfo(List<NodeInfo> nodes) {
-        this.nodes = nodes;
-    }
-}
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/api/NodeInfo.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/api/NodeInfo.java
deleted file mode 100644
index d2dab4c..0000000
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/api/NodeInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.event.api;
-
-public class NodeInfo {
-
-    private final String id;
-    private final String ip;
-
-    public NodeInfo(String id, String ip) {
-        this.id = id;
-        this.ip = ip;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public String getIp() {
-        return ip;
-    }
-}
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/driver/EventDriver.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/driver/EventDriver.java
index c92262c..415433e 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/driver/EventDriver.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/driver/EventDriver.java
@@ -41,33 +41,17 @@
 public class EventDriver {
 
     public static final String CLIENT_NODE_ID = "client_node";
-    public static final Node CLIENT_NODE = new Node(CLIENT_NODE_ID, "127.0.0.1", null, null, null, null, null, null);
+    public static final String CLUSTER_IP = "127.0.0.1";
+    public static final Node CLIENT_NODE = new Node(CLIENT_NODE_ID, CLUSTER_IP, null, null, null, null, null, null);
 
     private static String eventsDir;
-    private static Events events;
     private static Map<String, String> env = new HashMap<String, String>();
     private static String scriptDirSuffix;
 
-    public static String getEventsDir() {
-        return eventsDir;
-    }
-
-    public static Events getEvents() {
-        return events;
-    }
-
     public static Map<String, String> getEnvironment() {
         return env;
     }
 
-    public static String getStringifiedEnv(Cluster cluster) {
-        StringBuffer buffer = new StringBuffer();
-        for (Property p : cluster.getEnv().getProperty()) {
-            buffer.append(p.getKey() + "=" + p.getValue() + " ");
-        }
-        return buffer.toString();
-    }
-
     public static Cluster initializeCluster(String path) throws JAXBException, IOException {
         Cluster cluster = EventUtil.getCluster(path);
         for (Property p : cluster.getEnv().getProperty()) {
@@ -76,17 +60,6 @@
         return cluster;
     }
 
-    public static Patterns initializePatterns(String path) throws JAXBException, IOException {
-        File file = new File(path);
-        JAXBContext ctx = JAXBContext.newInstance(Patterns.class);
-        Unmarshaller unmarshaller = ctx.createUnmarshaller();
-        return (Patterns) unmarshaller.unmarshal(file);
-    }
-
-    private static void initialize(EventConfig eventConfig) throws IOException, JAXBException {
-
-    }
-
     public static void main(String[] args) throws Exception {
         String eventsHome = System.getenv("EVENT_HOME");
         if (eventsHome == null) {
@@ -104,14 +77,10 @@
                 Randomizer.getInstance(eventConfig.seed);
             }
             Cluster cluster = initializeCluster(eventConfig.clusterPath);
-            initialize(eventConfig);
 
             if (!eventConfig.dryRun) {
                 prepare(cluster);
             }
-            //AsterixEventServiceClient client = new AsterixEventServiceClient(eventsDir, cluster, eventConfig.dryRun,
-            //      new DefaultOutputHandler());
-            // client.submit(patterns);
             if (!eventConfig.dryRun) {
                 cleanup(cluster);
             }
@@ -123,12 +92,12 @@
 
     private static void prepare(Cluster cluster) throws IOException, InterruptedException {
 
-        scriptDirSuffix = "" + System.nanoTime();
+        scriptDirSuffix = Long.toString(System.nanoTime());
         List<String> args = new ArrayList<String>();
         args.add(scriptDirSuffix);
         Node clientNode = new Node();
         clientNode.setId("client");
-        clientNode.setClusterIp("127.0.0.1");
+        clientNode.setClusterIp(CLUSTER_IP);
         for (Node node : cluster.getNode()) {
             args.add(node.getClusterIp());
         }
@@ -140,7 +109,7 @@
         args.add(scriptDirSuffix);
         Node clientNode = new Node();
         clientNode.setId("client");
-        clientNode.setClusterIp("127.0.0.1");
+        clientNode.setClusterIp(CLUSTER_IP);
         for (Node node : cluster.getNode()) {
             args.add(node.getClusterIp());
         }
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/OutputHandler.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/OutputHandler.java
index 68e87c6..efb2ac4 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/OutputHandler.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/OutputHandler.java
@@ -41,7 +41,7 @@
         EventType eventType = EventType.valueOf(event.getType().toUpperCase());
         boolean ignore = true;
         String trimmedOutput = output.trim();
-        StringBuffer errorMessage = new StringBuffer();
+        StringBuilder errorMessage = new StringBuilder();
         switch (eventType) {
             case FILE_TRANSFER:
                 if (trimmedOutput.length() > 0) {
@@ -57,14 +57,9 @@
                 if (trimmedOutput.length() > 0) {
                     if (trimmedOutput.contains("AccessControlException")) {
                         errorMessage.append("Insufficient permissions on back up directory");
-                        ignore = false;
                     }
-                    if (output.contains("does not exist") || output.contains("File exist")
-                            || (output.contains("No such file or directory"))) {
-                        ignore = true;
-                    } else {
-                        ignore = false;
-                    }
+                    ignore = output.contains("does not exist") || output.contains("File exist")
+                            || (output.contains("No such file or directory"));
                 }
                 break;
 
@@ -87,10 +82,6 @@
             default:
                 break;
         }
-        if (ignore) {
-            return new OutputAnalysis(true, null);
-        } else {
-            return new OutputAnalysis(false, errorMessage.toString());
-        }
+        return ignore ? new OutputAnalysis(true, null) : new OutputAnalysis(false, errorMessage.toString());
     }
 }
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/VerificationUtil.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/VerificationUtil.java
index 71efa44..640422e 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/VerificationUtil.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/error/VerificationUtil.java
@@ -51,7 +51,6 @@
         boolean ccRunning = true;
         List<String> failedNCs = new ArrayList<String>();
         String[] infoFields;
-        ProcessInfo pInfo;
         List<ProcessInfo> processes = new ArrayList<ProcessInfo>();
 
         for (String line : output.split("\n")) {
@@ -64,8 +63,7 @@
                 } else {
                     nodeid = instance.getCluster().getMasterNode().getId();
                 }
-                pInfo = new ProcessInfo(infoFields[0], infoFields[1], nodeid, pid);
-                processes.add(pInfo);
+                processes.add(new ProcessInfo(infoFields[0], infoFields[1], nodeid, pid));
             } catch (Exception e) {
                 if (infoFields[0].equalsIgnoreCase("CC")) {
                     ccRunning = false;
@@ -79,11 +77,11 @@
 
     public static void updateInstanceWithRuntimeDescription(AsterixInstance instance, AsterixRuntimeState state,
             boolean expectedRunning) {
-        StringBuffer summary = new StringBuffer();
+        StringBuilder summary = new StringBuilder();
         if (expectedRunning) {
             if (!state.isCcRunning()) {
-                summary.append("Cluster Controller not running at " + instance.getCluster().getMasterNode().getId()
-                        + "\n");
+                summary.append(
+                        "Cluster Controller not running at " + instance.getCluster().getMasterNode().getId() + "\n");
                 instance.setState(State.UNUSABLE);
             }
             if (state.getFailedNCs() != null && !state.getFailedNCs().isEmpty()) {
@@ -113,7 +111,7 @@
 
     public static void verifyBackupRestoreConfiguration(String hdfsUrl, String hadoopVersion, String hdfsBackupDir)
             throws Exception {
-        StringBuffer errorCheck = new StringBuffer();
+        StringBuilder errorCheck = new StringBuilder();
         if (hdfsUrl == null || hdfsUrl.length() == 0) {
             errorCheck.append("\n HDFS Url not configured");
         }
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
index af33f2e..34c1837 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
@@ -196,8 +196,7 @@
 
             }
         }
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
+        return new Patterns(patternList);
     }
 
     private Pattern getDirectoryTransferPattern(String username, String src, Nodeid srcNode, String destNodeIp,
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/DefaultOutputHandler.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/DefaultOutputHandler.java
deleted file mode 100644
index 907a494..0000000
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/DefaultOutputHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.event.management;
-
-import org.apache.asterix.event.schema.pattern.Event;
-
-public class DefaultOutputHandler implements IOutputHandler {
-
-    @Override
-    public OutputAnalysis reportEventOutput(Event event, String output) {
-        return new OutputAnalysis(true, null);
-    }
-
-}
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/ErrorHandler.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/ErrorHandler.java
deleted file mode 100644
index fb2d1b7..0000000
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/ErrorHandler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.event.management;
-
-public class ErrorHandler {
-
-}
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventExecutor.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventExecutor.java
index 4587756..ebeea63 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventExecutor.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventExecutor.java
@@ -35,7 +35,6 @@
 
 public class EventExecutor {
 
-    public static final String EVENTS_DIR = "events";
     private static final String EXECUTE_SCRIPT = "execute.sh";
     private static final String IP_LOCATION = "IP_LOCATION";
     private static final String CLUSTER_ENV = "ENV";
@@ -49,7 +48,7 @@
         pargs.add("/bin/bash");
         pargs.add(client.getEventsHomeDir() + File.separator + AsterixEventServiceUtil.EVENT_DIR + File.separator
                 + EXECUTE_SCRIPT);
-        StringBuffer envBuffer = new StringBuffer(IP_LOCATION + "=" + node.getClusterIp() + " ");
+        StringBuilder envBuffer = new StringBuilder(IP_LOCATION + "=" + node.getClusterIp() + " ");
         boolean isMasterNode = node.getId().equals(cluster.getMasterNode().getId());
 
         if (!node.getId().equals(EventDriver.CLIENT_NODE_ID) && cluster.getEnv() != null) {
@@ -59,41 +58,11 @@
                     envBuffer.append(p.getKey() + "=" + val + " ");
                 } else if (p.getKey().equals(EventUtil.NC_JAVA_OPTS)) {
                     if (!isMasterNode) {
-                        StringBuilder builder = new StringBuilder();
-                        builder.append("\"");
-                        String javaOpts = p.getValue();
-                        if (javaOpts != null) {
-                            builder.append(javaOpts);
-                        }
-                        if (node.getDebugPort() != null) {
-                            int debugPort = node.getDebugPort().intValue();
-                            if (!javaOpts.contains("-Xdebug")) {
-                                builder.append(
-                                        (" " + "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address="
-                                                + debugPort));
-                            }
-                        }
-                        builder.append("\"");
-                        envBuffer.append("JAVA_OPTS" + "=" + builder + " ");
+                        appendJavaOpts(node, envBuffer, p);
                     }
                 } else if (p.getKey().equals(EventUtil.CC_JAVA_OPTS)) {
                     if (isMasterNode) {
-                        StringBuilder builder = new StringBuilder();
-                        builder.append("\"");
-                        String javaOpts = p.getValue();
-                        if (javaOpts != null) {
-                            builder.append(javaOpts);
-                        }
-                        if (node.getDebugPort() != null) {
-                            int debugPort = node.getDebugPort().intValue();
-                            if (!javaOpts.contains("-Xdebug")) {
-                                builder.append(
-                                        (" " + "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address="
-                                                + debugPort));
-                            }
-                        }
-                        builder.append("\"");
-                        envBuffer.append("JAVA_OPTS" + "=" + builder + " ");
+                        appendJavaOpts(node, envBuffer, p);
                     }
                 } else if (p.getKey().equals("LOG_DIR")) {
                     String val = node.getLogDir() == null ? p.getValue() : node.getLogDir();
@@ -106,7 +75,7 @@
             pargs.add(cluster.getUsername() == null ? System.getProperty("user.name") : cluster.getUsername());
         }
 
-        StringBuffer argBuffer = new StringBuffer();
+        StringBuilder argBuffer = new StringBuilder();
         if (args != null && args.size() > 0) {
             for (String arg : args) {
                 argBuffer.append(arg + " ");
@@ -118,7 +87,7 @@
         pb.environment().put(CLUSTER_ENV, envBuffer.toString());
         pb.environment().put(SCRIPT, script);
         pb.environment().put(ARGS, argBuffer.toString());
-        pb.environment().put(DAEMON, isDaemon ? "true" : "false");
+        pb.environment().put(DAEMON, Boolean.toString(isDaemon));
 
         Process p = pb.start();
         if (!isDaemon) {
@@ -132,4 +101,21 @@
             }
         }
     }
+
+    protected void appendJavaOpts(Node node, StringBuilder envBuffer, Property p) {
+        StringBuilder builder = new StringBuilder();
+        builder.append("\"");
+        String javaOpts = p.getValue();
+        if (javaOpts != null) {
+            builder.append(javaOpts);
+        }
+        if (node.getDebugPort() != null) {
+            int debugPort = node.getDebugPort().intValue();
+            if (javaOpts == null || !javaOpts.contains("-Xdebug")) {
+                builder.append(" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=").append(debugPort);
+            }
+        }
+        builder.append("\"");
+        envBuffer.append("JAVA_OPTS=").append(builder.toString()).append(" ");
+    }
 }
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventTask.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventTask.java
index e0e5bc4..29b855d 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventTask.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventTask.java
@@ -143,10 +143,6 @@
         return interval;
     }
 
-    public long getInitialDelay() {
-        return initialDelay;
-    }
-
     public Pattern getPattern() {
         return pattern;
     }
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventUtil.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventUtil.java
index 57648b8..55e0780 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventUtil.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/EventUtil.java
@@ -41,17 +41,11 @@
 public class EventUtil {
 
     public static final String EVENTS_DIR = "events";
-    public static final String CLUSTER_CONF = "config/cluster.xml";
-    public static final String PATTERN_CONF = "config/pattern.xml";
     public static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
     public static final String NC_JAVA_OPTS = "nc.java.opts";
     public static final String CC_JAVA_OPTS = "cc.java.opts";
 
     private static final String IP_LOCATION = "IP_LOCATION";
-    private static final String CLUSTER_ENV = "ENV";
-    private static final String SCRIPT = "SCRIPT";
-    private static final String ARGS = "ARGS";
-    private static final String EXECUTE_SCRIPT = "events/execute.sh";
 
     public static Cluster getCluster(String clusterConfigurationPath) throws JAXBException {
         File file = new File(clusterConfigurationPath);
@@ -201,7 +195,7 @@
                 return node;
             }
         }
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         buffer.append(EventDriver.CLIENT_NODE.getId() + ",");
         buffer.append(cluster.getMasterNode().getId() + ",");
         for (Node v : cluster.getNode()) {
@@ -211,27 +205,6 @@
         throw new IllegalArgumentException("Unknown node id :" + nodeid + " valid ids:" + buffer);
     }
 
-    public static void executeEventScript(Node node, String script, List<String> args, Cluster cluster)
-            throws IOException, InterruptedException {
-        List<String> pargs = new ArrayList<String>();
-        pargs.add("/bin/bash");
-        pargs.add(EventDriver.getEventsDir() + "/" + EXECUTE_SCRIPT);
-        StringBuffer argBuffer = new StringBuffer();
-        String env = EventDriver.getStringifiedEnv(cluster) + " " + IP_LOCATION + "=" + node.getClusterIp();
-        if (args != null) {
-            for (String arg : args) {
-                argBuffer.append(arg + " ");
-            }
-        }
-        ProcessBuilder pb = new ProcessBuilder(pargs);
-        pb.environment().putAll(EventDriver.getEnvironment());
-        pb.environment().put(IP_LOCATION, node.getClusterIp());
-        pb.environment().put(CLUSTER_ENV, env);
-        pb.environment().put(SCRIPT, script);
-        pb.environment().put(ARGS, argBuffer.toString());
-        pb.start();
-    }
-
     public static void executeLocalScript(Node node, String script, List<String> args) throws IOException,
             InterruptedException {
         List<String> pargs = new ArrayList<String>();
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/AsterixInstance.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/AsterixInstance.java
index e6c6986..f824d5b 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/AsterixInstance.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/AsterixInstance.java
@@ -66,10 +66,6 @@
         this.backupInfo = new ArrayList<BackupInfo>();
     }
 
-    public Date getModifiedTimestamp() {
-        return stateChangeTimestamp;
-    }
-
     public State getState() {
         return state;
     }
@@ -87,14 +83,6 @@
         return name;
     }
 
-    public Date getCreatedTimestamp() {
-        return createdTimestamp;
-    }
-
-    public Date getStateChangeTimestamp() {
-        return stateChangeTimestamp;
-    }
-
     public void setStateChangeTimestamp(Date stateChangeTimestamp) {
         this.stateChangeTimestamp = stateChangeTimestamp;
     }
@@ -112,7 +100,7 @@
     }
 
     public String getDescription(boolean detailed) {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         buffer.append("Name:" + name + "\n");
         buffer.append("Created:" + createdTimestamp + "\n");
 
@@ -150,15 +138,11 @@
         return "http://" + cluster.getMasterNode().getClientIp() + ":" + webPort;
     }
 
-    public AsterixRuntimeState getAsterixRuntimeState() {
-        return runtimeState;
-    }
-
     public void setAsterixRuntimeStates(AsterixRuntimeState runtimeState) {
         this.runtimeState = runtimeState;
     }
 
-    private void addDetailedInformation(StringBuffer buffer) {
+    private void addDetailedInformation(StringBuilder buffer) {
         buffer.append("Master node:" + cluster.getMasterNode().getId() + ":" + cluster.getMasterNode().getClusterIp()
                 + "\n");
         for (Node node : cluster.getNode()) {
@@ -196,7 +180,7 @@
 
     private String getIndentation(String name, int lenMax) {
         int len = name.length();
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         for (int i = 0; i < lenMax - len; i++) {
             buf.append(" ");
         }
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/BackupInfo.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/BackupInfo.java
index 38bb7a9..ae10cd7 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/BackupInfo.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/BackupInfo.java
@@ -58,7 +58,6 @@
     public String toString() {
         return id + " " + date + " " + "(" + getBackupType() + ")" + " " + "[ " + this.getBackupConf().getBackupDir()
                 + " ]";
-
     }
 
     public BackupType getBackupType() {
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/ProcessInfo.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/ProcessInfo.java
index f266b84..9702ceb 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/ProcessInfo.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/model/ProcessInfo.java
@@ -35,18 +35,10 @@
         this.processId = processId;
     }
 
-    public String getProcessName() {
-        return processName;
-    }
-
     public String getHost() {
         return host;
     }
 
-    public int getProcessId() {
-        return processId;
-    }
-
     public String getNodeId() {
         return nodeId;
     }
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventService.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventService.java
index 55a9200..f95b934 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventService.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventService.java
@@ -21,13 +21,12 @@
 import java.io.File;
 import java.io.FileFilter;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
 import org.apache.asterix.event.error.OutputHandler;
 import org.apache.asterix.event.management.AsterixEventServiceClient;
 import org.apache.asterix.event.schema.cluster.Cluster;
 import org.apache.asterix.installer.schema.conf.Configuration;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
 
 public class AsterixEventService {
 
@@ -46,15 +45,12 @@
 
     public static AsterixEventServiceClient getAsterixEventServiceClient(Cluster cluster, boolean transferArtifacts,
             boolean dryRun) throws Exception {
-        AsterixEventServiceClient client = new AsterixEventServiceClient(configuration, eventHome, cluster,
-                transferArtifacts, dryRun, OutputHandler.INSTANCE);
-        return client;
+        return new AsterixEventServiceClient(configuration, eventHome, cluster, transferArtifacts, dryRun,
+                OutputHandler.INSTANCE);
     }
 
     public static AsterixEventServiceClient getAsterixEventServiceClient(Cluster cluster) throws Exception {
-        AsterixEventServiceClient client = new AsterixEventServiceClient(configuration, eventHome, cluster, false,
-                false, OutputHandler.INSTANCE);
-        return client;
+        return new AsterixEventServiceClient(configuration, eventHome, cluster, false, false, OutputHandler.INSTANCE);
     }
 
     private static String initBinary(final String fileNamePattern) {
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventServiceUtil.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventServiceUtil.java
index 02c06dc..9b22396 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventServiceUtil.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/AsterixEventServiceUtil.java
@@ -65,33 +65,25 @@
 public class AsterixEventServiceUtil {
 
     public static final String TXN_LOG_DIR = "txnLogs";
-    public static final String TXN_LOG_DIR_KEY_SUFFIX = "txnLogDir";
     public static final String ASTERIX_CONFIGURATION_FILE = "asterix-configuration.xml";
-    public static final String TXN_LOG_CONFIGURATION_FILE = "log.properties";
     public static final String CLUSTER_CONFIGURATION_FILE = "cluster.xml";
-    public static final String ASTERIX_DIR = "asterix";
     public static final String EVENT_DIR = "events";
-    public static final String DEFAULT_ASTERIX_CONFIGURATION_PATH = "conf" + File.separator + File.separator
-            + "asterix-configuration.xml";
     public static final int CLUSTER_NET_PORT_DEFAULT = 1098;
     public static final int CLIENT_NET_PORT_DEFAULT = 1099;
     public static final int HTTP_PORT_DEFAULT = 8888;
-    public static final int WEB_INTERFACE_PORT_DEFAULT = 19001;
 
-    public static final String MANAGIX_INTERNAL_DIR = ".installer";
     public static final String MANAGIX_CONF_XML = "conf" + File.separator + "managix-conf.xml";
 
     private static final int BUFFER_SIZE = 4096;
 
     public static AsterixInstance createAsterixInstance(String asterixInstanceName, Cluster cluster,
-            AsterixConfiguration asterixConfiguration) throws FileNotFoundException, IOException {
+            AsterixConfiguration asterixConfiguration) throws IOException {
         Node metadataNode = getMetadataNode(asterixInstanceName, cluster);
         String asterixZipName = asterixZipName();
         String asterixVersion = asterixZipName.substring("asterix-server-".length(),
                 asterixZipName.indexOf("-binary-assembly"));
-        AsterixInstance instance = new AsterixInstance(asterixInstanceName, cluster, asterixConfiguration,
+        return new AsterixInstance(asterixInstanceName, cluster, asterixConfiguration,
                 metadataNode.getId(), asterixVersion);
-        return instance;
     }
 
     public static void createAsterixZip(AsterixInstance asterixInstance)
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ServiceProvider.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ServiceProvider.java
index 7606a25..ab421fd 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ServiceProvider.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ServiceProvider.java
@@ -24,7 +24,6 @@
     private static ILookupService lookupService = new ZooKeeperService();
 
     private ServiceProvider() {
-
     }
 
     public ILookupService getLookupService() {
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ZooKeeperService.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ZooKeeperService.java
index a10b5ea..ee80894 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ZooKeeperService.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ZooKeeperService.java
@@ -67,7 +67,7 @@
     public boolean isRunning(Configuration conf) throws Exception {
         List<String> servers = conf.getZookeeper().getServers().getServer();
         int clientPort = conf.getZookeeper().getClientPort().intValue();
-        StringBuffer connectionString = new StringBuffer();
+        StringBuilder connectionString = new StringBuilder();
         for (String serverAddress : servers) {
             connectionString.append(serverAddress);
             connectionString.append(":");
@@ -101,7 +101,7 @@
         ZookeeperUtil.writeConfiguration(ZOO_KEEPER_CONFIG, conf, ZOOKEEPER_LEADER_CONN_PORT,
                 ZOOKEEPER_LEADER_ELEC_PORT);
         String initScript = ZOOKEEPER_HOME + File.separator + "bin" + File.separator + "zk.init";
-        StringBuffer cmdBuffer = new StringBuffer();
+        StringBuilder cmdBuffer = new StringBuilder();
         cmdBuffer.append(initScript + " ");
         cmdBuffer.append(conf.getZookeeper().getHomeDir() + " ");
         cmdBuffer.append(conf.getZookeeper().getServers().getJavaHome() + " ");
@@ -137,7 +137,7 @@
             LOGGER.debug("Stopping ZooKeeper running at " + zkConnectionString);
         }
         String stopScript = ZOOKEEPER_HOME + File.separator + "bin" + File.separator + "stop_zk";
-        StringBuffer cmdBuffer = new StringBuffer();
+        StringBuilder cmdBuffer = new StringBuilder();
         cmdBuffer.append(stopScript + " ");
         cmdBuffer.append(conf.getZookeeper().getHomeDir() + " ");
         List<String> zkServers = conf.getZookeeper().getServers().getServer();
@@ -282,7 +282,7 @@
     public static void writeConfiguration(String zooKeeperConfigPath, Configuration conf, int leaderConnPort,
             int leaderElecPort) throws IOException {
 
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         buffer.append("tickTime=1000" + "\n");
         buffer.append("dataDir=" + conf.getZookeeper().getHomeDir() + File.separator + "data" + "\n");
         buffer.append("clientPort=" + conf.getZookeeper().getClientPort().intValue() + "\n");
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/util/PatternCreator.java b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/util/PatternCreator.java
index 1780a51..9c6725b 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/util/PatternCreator.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/util/PatternCreator.java
@@ -54,8 +54,6 @@
     private PatternCreator() {
     }
 
-    private ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
-
     private void addInitialDelay(Pattern p, int delay, String unit) {
         Delay d = new Delay(new Value(null, Integer.toString(delay)), unit);
         p.setDelay(d);
@@ -102,26 +100,6 @@
         return new Patterns(ps);
     }
 
-    public Patterns getStopCommandPattern(String asterixInstanceName) throws Exception {
-        List<Pattern> ps = new ArrayList<>();
-        AsterixInstance asterixInstance = lookupService.getAsterixInstance(asterixInstanceName);
-        Cluster cluster = asterixInstance.getCluster();
-
-        String ccLocation = cluster.getMasterNode().getId();
-        Pattern createCC = createCCStopPattern(ccLocation);
-        addInitialDelay(createCC, 5, "sec");
-        ps.add(createCC);
-
-        int nodeControllerIndex = 1;
-        for (Node node : cluster.getNode()) {
-            Pattern createNC = createNCStopPattern(node.getId(), asterixInstanceName + "_" + nodeControllerIndex);
-            ps.add(createNC);
-            nodeControllerIndex++;
-        }
-
-        return new Patterns(ps);
-    }
-
     public Patterns getBackUpAsterixPattern(AsterixInstance instance, Backup backupConf) throws Exception {
         BackupType backupType = BackupInfo.getBackupType(backupConf);
         Patterns patterns = null;
@@ -600,7 +578,7 @@
         return new Patterns(ps);
     }
 
-    public Patterns getGenerateLogPattern(String asterixInstanceName, Cluster cluster, String outputDir) {
+    public Patterns getGenerateLogPattern(Cluster cluster, String outputDir) {
         List<Pattern> patternList = new ArrayList<>();
         Map<String, String> nodeLogs = new HashMap<>();
 
diff --git a/asterixdb/asterix-installer/src/main/java/org/apache/asterix/installer/command/LogCommand.java b/asterixdb/asterix-installer/src/main/java/org/apache/asterix/installer/command/LogCommand.java
index b4ea96b..1e00d70 100644
--- a/asterixdb/asterix-installer/src/main/java/org/apache/asterix/installer/command/LogCommand.java
+++ b/asterixdb/asterix-installer/src/main/java/org/apache/asterix/installer/command/LogCommand.java
@@ -58,7 +58,7 @@
                 throw new InstallerException("Unable to create output directory:" + outputDirPath);
             }
         }
-        Patterns transferLogPattern = pc.getGenerateLogPattern(asterixInstanceName, instance.getCluster(),
+        Patterns transferLogPattern = pc.getGenerateLogPattern(instance.getCluster(),
                 outputDirPath);
         eventrixClient.submit(transferLogPattern);
         File outputDirFile = new File(outputDirPath);
