adding JSDoc + remove unused function