Improve UI memory handing.