Refactoring, moving logic into classes that make more sense.