Implmenting three design patterns