tweaked collapse list to prevent some duplication of code