Refactoring the code to make more readable.