Begin refactoring of code