--- a/src/execmd.cpp
+++ b/src/execmd.cpp
@@ -31,12 +31,13 @@
 
 #include <vector>
 #include <string>
-#include <memory>
 
 #include "execmd.h"
 
 #include "netcon.h"
 #include "closefrom.h"
+
+using namespace std;
 
 extern char **environ;
 
@@ -63,20 +64,17 @@
 #define MIN(A,B) ((A) < (B) ? (A) : (B))
 #endif
 
-static void stringToTokens(const std::string &s, 
-                           std::vector<std::string> &tokens, 
-                           const std::string &delims = " \t", 
-                           bool skipinit=true);
-
-static void stringToTokens(const std::string& str, 
-                           std::vector<std::string>& tokens,
-                           const std::string& delims, bool skipinit)
-{
-    std::string::size_type startPos = 0, pos;
+static void stringToTokens(const string &s, vector<string> &tokens, 
+                           const string &delims = " \t", bool skipinit=true);
+
+static void stringToTokens(const string& str, vector<string>& tokens,
+                           const string& delims, bool skipinit)
+{
+    string::size_type startPos = 0, pos;
 
     // Skip initial delims, return empty if this eats all.
     if (skipinit && 
-	(startPos = str.find_first_not_of(delims, 0)) == std::string::npos) {
+	(startPos = str.find_first_not_of(delims, 0)) == string::npos) {
 	return;
     }
     while (startPos < str.size()) { 
@@ -84,13 +82,13 @@
         pos = str.find_first_of(delims, startPos);
 
         // Add token to the vector and adjust start
-	if (pos == std::string::npos) {
+	if (pos == string::npos) {
 	    tokens.push_back(str.substr(startPos));
 	    break;
 	} else if (pos == startPos) {
 	    // Dont' push empty tokens after first
 	    if (tokens.empty())
-		tokens.push_back(std::string());
+		tokens.push_back(string());
 	    startPos = ++pos;
 	} else {
 	    tokens.push_back(str.substr(startPos, pos - startPos));
@@ -116,8 +114,7 @@
     return false;
 }
 
-bool ExecCmd::which(const std::string& cmd, std::string& exepath, 
-                    const char* path)
+bool ExecCmd::which(const string& cmd, string& exepath, const char* path)
 {
     if (cmd.empty()) 
 	return false;
@@ -139,14 +136,12 @@
     if (pp == 0)
 	return false;
 
-    std::vector<std::string> pels;
+    vector<string> pels;
     stringToTokens(pp, pels, ":");
-    for (std::vector<std::string>::iterator it = pels.begin(); 
-         it != pels.end(); it++) {
+    for (vector<string>::iterator it = pels.begin(); it != pels.end(); it++) {
 	if (it->empty())
 	    *it = ".";
-	std::string candidate = (it->empty() ? std::string(".") : *it) + 
-            "/" + cmd;
+	string candidate = (it->empty() ? string(".") : *it) + "/" + cmd;
 	if (exec_is_there(candidate.c_str())) {
 	    exepath = candidate;
 	    return true;
@@ -155,14 +150,14 @@
     return false;
 }
 
-void  ExecCmd::putenv(const std::string &ea)
+void  ExecCmd::putenv(const string &ea)
 {
     m_env.push_back(ea);
 }
 
-void  ExecCmd::putenv(const std::string &name, const std::string& value)
-{
-    std::string ea = name + "=" + value;
+void  ExecCmd::putenv(const string &name, const string& value)
+{
+    string ea = name + "=" + value;
     putenv(ea);
 }
 
@@ -222,8 +217,8 @@
                         grp, errno));
             }
 	}
-	m_parent->m_tocmd = std::shared_ptr<Netcon>();
-	m_parent->m_fromcmd = std::shared_ptr<Netcon>();
+	m_parent->m_tocmd.reset();
+	m_parent->m_fromcmd.reset();
 	pthread_sigmask(SIG_UNBLOCK, &m_parent->m_blkcld, 0);
 	m_parent->reset();
     }
@@ -250,7 +245,7 @@
 // If one of the calls block, the problem manifests itself by 20mn
 // (filter timeout) of looping on "ExecCmd::doexec: selectloop
 // returned 1', because the father is waiting on the read descriptor
-inline void ExecCmd::dochild(const std::string &cmd, const char **argv,
+inline void ExecCmd::dochild(const string &cmd, const char **argv,
 			     const char **envv,
 			     bool has_input, bool has_output)
 {
@@ -320,13 +315,12 @@
     _exit(127);
 }
 
-int ExecCmd::startExec(const std::string &cmd, 
-                       const std::vector<std::string>& args,
+int ExecCmd::startExec(const string &cmd, const vector<string>& args,
 		       bool has_input, bool has_output)
 {
     { // Debug and logging
-	std::string command = cmd + " ";
-	for (std::vector<std::string>::const_iterator it = args.begin();
+	string command = cmd + " ";
+	for (vector<string>::const_iterator it = args.begin();
              it != args.end(); it++) {
 	    command += "{" + *it + "} ";
 	}
@@ -364,7 +358,7 @@
     // Fill up argv
     argv[0] = cmd.c_str();
     int i = 1;
-    std::vector<std::string>::const_iterator it;
+    vector<string>::const_iterator it;
     for (it = args.begin(); it != args.end(); it++) {
 	argv[i++] = it->c_str();
     }
@@ -384,14 +378,14 @@
     int eidx;
     for (eidx = 0; eidx < envsize; eidx++)
 	envv[eidx] = environ[eidx];
-    for (std::vector<std::string>::const_iterator it = m_env.begin(); 
+    for (vector<string>::const_iterator it = m_env.begin(); 
 	 it != m_env.end(); it++) {
 	envv[eidx++] = it->c_str();
     }
     envv[eidx] = 0;
 
     // As we are going to use execve, not execvp, do the PATH thing.
-    std::string exe;
+    string exe;
     if (!which(cmd, exe)) {
         LOGERR(("ExecCmd::startExec: %s not found\n", cmd.c_str()));
         free(argv);
@@ -463,7 +457,7 @@
 // Netcon callback. Send data to the command's input
 class ExecWriter : public NetconWorker {
 public:
-    ExecWriter(const std::string *input, ExecCmdProvide *provide) 
+    ExecWriter(const string *input, ExecCmdProvide *provide) 
 	: m_input(input), m_cnt(0), m_provide(provide)
     {}				    
     virtual int data(NetconData *con, Netcon::Event reason)
@@ -497,7 +491,7 @@
 	return ret;
     }
 private:
-    const std::string   *m_input;
+    const string   *m_input;
     unsigned int    m_cnt; // Current offset inside m_input
     ExecCmdProvide *m_provide;
 };
@@ -505,7 +499,7 @@
 // Netcon callback. Get data from the command output.
 class ExecReader : public NetconWorker {
 public:
-    ExecReader(std::string *output, ExecCmdAdvise *advise) 
+    ExecReader(string *output, ExecCmdAdvise *advise) 
 	: m_output(output), m_advise(advise)
     {}				    
     virtual int data(NetconData *con, Netcon::Event reason)
@@ -523,14 +517,13 @@
 	return n;
     }
 private:
-    std::string        *m_output;
+    string        *m_output;
     ExecCmdAdvise *m_advise;
 };
 
 
-int ExecCmd::doexec(const std::string &cmd, 
-                    const std::vector<std::string>& args,
-		    const std::string *input, std::string *output)
+int ExecCmd::doexec(const string &cmd, const vector<string>& args,
+		    const string *input, string *output)
 {
 
     if (startExec(cmd, args, input != 0, output != 0) < 0) {
@@ -549,11 +542,11 @@
 		LOGERR(("ExecCmd::doexec: no connection from command\n"));
 		return -1;
 	    }
-	    oclicon->setcallback(std::make_shared<ExecReader>
+	    oclicon->setcallback(make_shared<ExecReader>
 				 (ExecReader(output, m_advise)));
 	    myloop.addselcon(m_fromcmd, Netcon::NETCONPOLL_READ);
 	    // Give up ownership 
-	    m_fromcmd = std::shared_ptr<Netcon>(0);
+	    m_fromcmd.reset();
 	} 
         // Setup input
 	if (input) {
@@ -562,11 +555,11 @@
 		LOGERR(("ExecCmd::doexec: no connection from command\n"));
 		return -1;
 	    }
-	    iclicon->setcallback(std::make_shared<ExecWriter>
+	    iclicon->setcallback(make_shared<ExecWriter>
 				 (ExecWriter(input, m_provide)));
 	    myloop.addselcon(m_tocmd, Netcon::NETCONPOLL_WRITE);
 	    // Give up ownership 
-	    m_tocmd = std::shared_ptr<Netcon>(0);
+	    m_tocmd.reset();
 	}
 
         // Do the actual reading/writing/waiting
@@ -607,7 +600,7 @@
     return ret1;
 }
 
-int ExecCmd::send(const std::string& data)
+int ExecCmd::send(const string& data)
 {
     NetconCli *con = dynamic_cast<NetconCli *>(m_tocmd.get());
     if (con == 0) {
@@ -628,7 +621,7 @@
     return nwritten;
 }
 
-int ExecCmd::receive(std::string& data, int cnt)
+int ExecCmd::receive(string& data, int cnt)
 {
     NetconCli *con = dynamic_cast<NetconCli *>(m_fromcmd.get());
     if (con == 0) {
@@ -655,7 +648,7 @@
     return ntot;
 }
 
-int ExecCmd::getline(std::string& data, int timeo)
+int ExecCmd::getline(string& data, int timeo)
 {
     NetconCli *con = dynamic_cast<NetconCli *>(m_fromcmd.get());
     if (con == 0) {
@@ -719,11 +712,11 @@
 }
 
 // Static
-bool ExecCmd::backtick(const std::vector<std::string> cmd, std::string& out)
-{
-    std::vector<std::string>::const_iterator it = cmd.begin();
+bool ExecCmd::backtick(const vector<string> cmd, string& out)
+{
+    vector<string>::const_iterator it = cmd.begin();
     it++;
-    std::vector<std::string> args(it, cmd.end());
+    vector<string> args(it, cmd.end());
     ExecCmd mexec;
     int status = mexec.doexec(*cmd.begin(), args, 0, &out);
     return status == 0;
@@ -747,12 +740,12 @@
     free(cd);
 }
 
-void ReExec::insertArgs(const std::vector<std::string>& args, int idx)
-{
-    std::vector<std::string>::iterator it, cit;
+void ReExec::insertArgs(const vector<string>& args, int idx)
+{
+    vector<string>::iterator it, cit;
     unsigned int cmpoffset = (unsigned int)-1;
 
-    if (idx == -1 || std::string::size_type(idx) >= m_argv.size()) {
+    if (idx == -1 || string::size_type(idx) >= m_argv.size()) {
 	it = m_argv.end();
 	if (m_argv.size() >= args.size()) {
 	    cmpoffset = m_argv.size() - args.size();
@@ -780,9 +773,9 @@
     m_argv.insert(it, args.begin(), args.end());
 }
 
-void ReExec::removeArg(const std::string& arg)
-{
-    for (std::vector<std::string>::iterator it = m_argv.begin(); 
+void ReExec::removeArg(const string& arg)
+{
+    for (vector<string>::iterator it = m_argv.begin(); 
 	 it != m_argv.end(); it++) {
 	if (*it == arg)
 	    it = m_argv.erase(it);
@@ -799,7 +792,7 @@
     FILE *fp = stdout; //fopen("/tmp/exectrace", "w");
     if (fp) {
 	fprintf(fp, "reexec: pwd: [%s] args: ", cwd?cwd:"getcwd failed");
-	for (std::vector<std::string>::const_iterator it = m_argv.begin();
+	for (vector<string>::const_iterator it = m_argv.begin();
 	     it != m_argv.end(); it++) {
 	    fprintf(fp, "[%s] ", it->c_str());
 	}
@@ -835,7 +828,7 @@
 	
     // Fill up argv
     int i = 0;
-    std::vector<std::string>::const_iterator it;
+    vector<string>::const_iterator it;
     for (it = m_argv.begin(); it != m_argv.end(); it++) {
 	argv[i++] = it->c_str();
     }