Simple implementation of some design patterns