I'd prefer to see this defined as a named function, it's pretty long.