General utilities used by PortaView.