refactored api's with abstraction