refactor ajax for creating new order