cleaned up the api