Refactors more view templates and controllers to remove excess database queries