To me, this question really boils down to finding good legal council with relevant domain experience because the fine grained details of your specific situation are what really matters. The broad strokes that are possible depend mostly on avoiding the serious pitfalls written in fine print.
Good luck.