refactoring for API
source formatting