Code total refactoring