factor out buzzer calls into a function