Adding logging and dependency inversion (kind of..)