Refactor code for cleaner look and more legible.