UpCodes Interview Question

When do you consider to make a code refactoring?