This function is designed for API usage.