improve re-rendering