use named function expressions wherever practical, for easier debugging