Cleaning up tod Javascript.