more tidying of API