Simplify slider function