[webui] More DRYed code