start of an API for the convenience of plugin writers