NR-610 : Complete the security gateway

Refactored the distrbution component