created a delegate and used it inside the CommandProcessor class