Restore for_context method, which still seems to be used