JS Refactory