Cleaning up JS a bit.