refactor scrollElements