Cleaned up code for collapsible