Added JSDoc comments to internal helper functions.