refactoring slider creation