Refatoring Test of JS