Added edit functionality and extracted common HTML snippets into partials