Associate loan products with offices

1) In this request create/edit  loan products with associate offices . And showing loan products based on the group/client office id while creating/editing loan a /c(group loan, jlg loan, individual loan) and loan products which are not associated with office for client/group.
2)re factoring code,  the deepCopy() method same lines of code repeated in more than 4 to 5 files. So i have created a new file called DeepClone.js  I have put the method deepCopy() in this file, the files depends on this method can be called by creating the object for DeepClone.js