Slight change in refactoring script making it easier to implement.