more simplifications within scroll function