refine the API