Refactored display_template_edit for better modularity (TUI-20)