start cleaning up JS a bit in general and per issue #42