Improve handling the UI update