A lot of this is quite old code, which we can shorten slightly by using arrow functions instead of "regular" functions.