Improved order logic. Added client fields to data