refactored the templates for adding and editing items