refactor slider