nit: move the comment to line 123 as it applies to the whole function. It is not related to "var self = this".