Move styling and event handlers out of HTML