cleaning js code and others fixes