updating only relevant parts of the page