Refactor: extracting methods to a parent class