Extracting some logic into a class method.

Modularity!