simplify slider logic