refactored to separate slider from counter