---
title: Complex refactoring in simple steps Part III | Codurance
description: Our team of dedicated software craftspeople provides consultancy, software development, and training services to clients seeking high quality development processes and software solutions.
---

[Publications | Codurance ](https://www.codurance.com/publications)

# [Complex refactoring in simple steps Part III | Codurance](https://www.codurance.com/publications/videos/2017-01-30-complex-refactoring-in-simple-steps-iii)

 Written by [Matthew Butt](https://www.codurance.com/publications/author/matthew-butt) | 30 Jan 2017

## Screencast - Complex refactoring in simple steps, Part III: From Conditional to Polymorphism

Matthew Butt demonstrates how to compose simple automated refactoring steps in ReSharper to refactor code to better designs.

In this episode we identify three classes that are being used in the same way. We introduce a common abstraction, and separate their creation and invocation. Finally, we remove a [Middleman](https://sourcemaking.com/refactoring/smells/middle-man) class to complete our journey to polymorphism.

The code used in this video can be found [on GitHub](https://github.com/bnathyuw/Complex-Refactoring-In-Simple-Steps)

[View full post](https://www.codurance.com/publications/videos/2017-01-30-complex-refactoring-in-simple-steps-iii)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Matthew Butt"
  },
  "dateModified" : "2021-02-05T15:57:07.967Z",
  "datePublished" : "2017-01-30T00:00:00Z",
  "headline" : "Complex refactoring in simple steps Part III",
  "image" : {
    "@type" : "ImageObject",
    "height" : 1281,
    "url" : "https://f.hubspotusercontent10.net/hubfs/3042464/Imported_Blog_Media/complex-refactoring-in-simple-steps-III.jpg",
    "width" : 2049
  },
  "mainEntityOfPage" : "https://www.codurance.com/publications/videos/2017-01-30-complex-refactoring-in-simple-steps-iii",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Publications"
  }
}
```