Zahid,
Numerous issues here, not least the country in which the contract operates. Most countries have special "common law" that you sometimes can and sometimes can't contract out of, and issues of copyright/ownership vary from country to country. I can tell you from personal experience that the US is different from Australasia which is different from the UK which is different from France. And it all changes again if vendor and customer are in different jurisdictions.
So, my advice is to find a lawyer who has done this before. Before you pay anything, confirm you're paying for advice based on experience, not "research" ("research" means an inexperienced person reads up the law and gives you a cautious interpretation that may not be relevant in the real world - sort of like an inexperienced doctor reading textbooks about gall bladder surgery at your cost, then offering to perform the procedure!). Make it clear you are also paying for modification of proven contracts for your purpose, not an exciting new contract built from scratch at enormous cost. Finally, don't be afraid to spend some money getting the best lawyer; often a lawyer who charges twice as much gets it done twice as quickly and saves you huge difficulty downstream.
Good luck!
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us."
-- Shakespeare: Coriolanus, Act 1, scene 1