An excercize to refact bad code.