Refined the API further and added java doc comments.