improve performance, update layout and do scrolling more accurate