Refactoring for clarity of the code