refactoring and general code cleanup on scrolls