End of Refactoring the code