STREAMS-190 | Refactored to remove repeated code