Minor refactor (and test)