Is it correct to use "to do" twice in a sentence? For example: is it correct to say "how to do that and when to do that is a problem" or should it be "how to do that and when doing that is a problem"?