[webui] some code improvements