abstracting a method to make the code a little more readable.