[899753] Part 1: Added more jsdocs and refactor