polished the api