Refactored some templates and views