Refactor

Wishing I could go back in time and ask myself what the heck I was
doing.
Apparently I wrote a ridiculously monolithic function in this project. I
remember having a headache getting some of it to work and finished it at
like 2am.

I think it's about time to start fixing that since I have to dig into
the codebase to fix a bug anyway.

First salvo in this fight is refactoring the drive type identification
as its own function.