Cleanup some more defects and especially got rid of lot of useless code around network releated functions