Code move in .js file