Use block to simplify the API