Robert C. Martin (Uncle Bob) shows some refactoring techniques transforming a “large and ugly” function into a clean and readable piece of Java code, using IntelliJ IDEA and refactorings such as Rename, Extract Method, Inline Variable, Introduce Field, etc.