Refactor scrollbar position bottom handling.