Issue #2: Polishing stream handler and updating main script.