Update api to improve reusability.