Refactoring the code so it could be more readable.