We reduced an if/else statement and pulled a while loop into its own
method.