DRYing, logging, refactoring.