JSdoc and cleanup