refactoring + fixed bug with slides