Read the following sentence:
Not only the teacher but also the students were enthusiastic about the upcoming science fair, which had been planned for months and they organized every detail carefully.
Which of the following options best improves the structure of this sentence?