Moving slides logic out of slides view