Tests pass. Could do with an api tidy.