VID-1888 Split out anonymous function into named function