Modernize code