General refactoring of the code and scripts
Refactoring of code and scripts