Remake of the codes in design pattern.