refactoring slider