refactored code, subscribe to addresses