diff --git a/src/main/java/com/att/nsa/mr/dme/client/SimpleExampleConsumer.java b/src/main/java/com/att/nsa/mr/dme/client/SimpleExampleConsumer.java
index bc54a01..bdd15d4 100644
--- a/src/main/java/com/att/nsa/mr/dme/client/SimpleExampleConsumer.java
+++ b/src/main/java/com/att/nsa/mr/dme/client/SimpleExampleConsumer.java
@@ -32,14 +32,20 @@
 import com.att.nsa.mr.client.MRClientFactory;
 import com.att.nsa.mr.client.MRConsumer;
 
+import java.util.List;
+
 public class SimpleExampleConsumer {
 
 	private static final Logger logger = LoggerFactory.getLogger(SimpleExampleConsumer.class);
 
+    private SimpleExampleConsumer() {
+    }
+
 	public static void main(String[] args) {
 
 		long count = 0;
 		long nextReport = 5000;
+                String key;
 
 		final long startMs = System.currentTimeMillis();
 
@@ -48,22 +54,23 @@
 			final MRConsumer cc = MRClientFactory.createConsumer("D:\\SG\\consumer.properties");
 			while (true) {
 				for (String msg : cc.fetch()) {
-
-					System.out.println("Message Received: " + msg);
+                                        logger.debug("Message Received: " + msg);
 				}
 				// Header for DME2 Call.
 				MultivaluedMap<String, Object> headersMap = MRClientFactory.HTTPHeadersMap;
-				for (String key : headersMap.keySet()) {
-					System.out.println("Header Key " + key);
-					System.out.println("Header Value " + headersMap.get(key));
+				for (MultivaluedMap.Entry<String,List<Object>> entry: headersMap.entrySet()) {
+                                    key = entry.getKey();
+                                    logger.debug("Header Key " + key);
+                                    logger.debug("Header Value " + headersMap.get(key));
 				}
 				// Header for HTTP Call.
 				
-				 Map<String, String>
-				 dme2headersMap=MRClientFactory.DME2HeadersMap; for(String key
-				  : dme2headersMap.keySet()) { System.out.println("Header Key "
-				+ key); System.out.println("Header Value " +
-				  dme2headersMap.get(key)); }
+				 Map<String, String> dme2headersMap=MRClientFactory.DME2HeadersMap;
+                                 for(Map.Entry<String,String> entry: dme2headersMap.entrySet()) {
+                                     key = entry.getKey();
+                                     logger.debug("Header Key " + key);
+                                     logger.debug("Header Value " + dme2headersMap.get(key));
+                                 }
 				 
 				if (count > nextReport) {
 					nextReport += 5000;
@@ -72,12 +79,11 @@
 					final long elapsedMs = endMs - startMs;
 					final double elapsedSec = elapsedMs / 1000.0;
 					final double eps = count / elapsedSec;
-					System.out.println("Consumed " + count + " in " + elapsedSec + "; " + eps + " eps");
+					logger.error("Consumed " + count + " in " + elapsedSec + "; " + eps + " eps");
 				}
 			}
 		} catch (Exception x) {
-			System.err.println(x.getClass().getName() + ": " + x.getMessage());
-                    logger.error("exception: ", x);
+                    logger.error(x.getClass().getName() + ": " + x.getMessage());
 		}
 	}
 }
