small refactoring of slider