cleanup: use type switches where appropriate
Merge pull request #16 from ComputerDruid/cleanup

cleanup: use type switches where appropriate