refactor js, fix paths