snake.html refactor