Refactors localDescription set and onmessage control flow