Split in files.
Encapsulations
Bugfix in case of process error.
Log messages improved.
Merge pull request #1 from odise/refactoring

Refactoring