Refactoring

Method extraction mainly