Supplement JSDoc with undocumented annotations
Form a template method to rid duplicated codes
Extract a method to rid complexity
Extract a method to rid duplicated threshold handling
Use an iterator to rid duplicated codes
Tidy a wasted line-break
Form a template method to rid duplicated codes