refactored to comlply our API