Small refactoring of API access.