Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series …