Refactoring and fix slider