Building out part of the front end to make the javascript clearer and avoid repeats with templates.