refactor of slider