Remove sections of code from files based on conditions