Modernize the code a little