refactores js