Starting to cleanup the wifi code.