condense processContext fn, move yml.extract above the return statement (per @doowb's suggestion)