refactor debug.html