a lot of refactorings of the API