cleaning up JS a bit...