Modified to satisfy javascript code style