refactoring is--expanded and is--collapsed markup and styling