Refractoring the slider