Refactoring and changed CollapsibleFrame to not use an offscreen image for rendering.