move some functions out of the example code and into the generic blinking model code