refactor repeated code, which seems to fix #302 by fixing collapsable vs collapsible