Refactoring the code to look better.