fix notes + js refactoring