This is a implementation often used by plugins.