added refresh fonction + cleaning js code