use generator to reduce memory usage
keep white spaces, since code_part contains them