Modernize the code, styling fixes