refactoring due to introduction of api