Use specific imports instead of *, Reorder
Check if wifi is loginable in separate utility function

* This is a good thing to modularise. We might also need to change the logic of
  this particular module in future