KAZOO-435: move shared functionality into util module