Modernized and harmonized the code