design pattern implementation