refactor scrollspy refresh method