Removed some bit rot
Refactor for clarity
Unit test tweaks to return values