Refactoring little bits of the code to match the comments on the review.