cleaning js syntax