cleaning js code