Modernize this code