JS Refactro