Refactor WebUI