refactored publish package to be functional. added Chain of Responsibility pattern implementation in commons.util.Chain