`recordHuntWithPrehuntUser` has a nested javascript function. There may be other culprits but all need to be refactored to just a separate function.