added logic to handle different order type creations