Refactored wireless code. Much cleaner