Refactor and remove unused code from the front end of the manage.html template