js code cleaned