Refactoring the code.