refactoring the API so it can be used at the highest level