Improve rendering performance and fix scrolling