wifiscan code cleanup and style improvements