Removed collapse's dependency on dom structure and panel class