modularized a function for buffering the slider and implemented that for event handlers using it