Apply feedback from JS code review