Few JS improvements