[all] Refactoring of the code.