cleaning up JS a little