REFACTORING: fixed code style and lint warnings. Readded jsdoc lost in merge.