add chain of responsibility design pattern.