Refactoring with ASTs and Pattern Matching

Refactoring