Massively refactor run HTML script