New Refactoring of the code