Refactoring to make things a little more readable.