Fix deletion of fields from fields template view

* Minor refactoring to fix also updating of fields