refactoring, exanding API