order management order inserting but code is too complex