table scroll + massive refactoring/optimization