More modular structure of the listener + first sketch of a daemon version of the same sw.
BE CAREFUL: the daemon version is not working