Clean up javascript code style