cleanup wifi code