Modularize browser and HTML file logic