complete refactor of edit and show code to be more concise and support dynamic collapsible panels when needed