WIP; API needs thinking about.