Refactor slider