Generalise hide/reveal functionality