Simplify the solution and isolate it fromt the fix of YARN-382.