code redction of fetch.c