refactor the order.js