I don't really understand why you need to do this. Looks like you're solving the wrong problem.