def refactoring_example(spellbook): result = [] for spell in spellbook: if spell.is_awesome: result.append(spell) return result