MOAR TESTS (and some slight refactoring)
'