KAZOO-3140: cleanup formatting, specs
KAZOO-3140: add spec, refactor case into function clauses