general cleanup and jsdocs