Accordion refactor into function declarations