Added the chain of responsibility and template method